aboutsummaryrefslogtreecommitdiff
path: root/bin/ak-ipfs-add
diff options
context:
space:
mode:
authorkaotisk <kaotisk@arching-kaos.org>2023-07-30 20:08:57 +0300
committerkaotisk <kaotisk@arching-kaos.org>2023-07-30 20:08:57 +0300
commit58b888574923c46c3854090c5cd5d8106e39d46a (patch)
tree3aa553a5e8f5b63e0fc01f53d73175da63f46016 /bin/ak-ipfs-add
parentd512be24515b0afb669578d16576fe2db840990b (diff)
downloadarching-kaos-tools-58b888574923c46c3854090c5cd5d8106e39d46a.tar.gz
arching-kaos-tools-58b888574923c46c3854090c5cd5d8106e39d46a.tar.bz2
arching-kaos-tools-58b888574923c46c3854090c5cd5d8106e39d46a.zip
Added checks to detect success and failure of underlying commands being run
Diffstat (limited to 'bin/ak-ipfs-add')
-rwxr-xr-xbin/ak-ipfs-add9
1 files changed, 8 insertions, 1 deletions
diff --git a/bin/ak-ipfs-add b/bin/ak-ipfs-add
index c3f75f1..63862b7 100755
--- a/bin/ak-ipfs-add
+++ b/bin/ak-ipfs-add
@@ -1,3 +1,10 @@
#!/bin/bash
+PROGRAM="$(basename $0)"
+# Receives a file
+# Returns a hash
ipfs add -Qr "$1"
-
+if [ "$?" != "0" ]
+then
+ ak-logthis "<$PROGRAM>" "[ERROR]" "Failed to add $1"
+ exit 1
+fi