summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dot_anypaste-plugins/executable_anyminio10
-rw-r--r--dot_anypaste-plugins/executable_brpaste2
2 files changed, 8 insertions, 4 deletions
diff --git a/dot_anypaste-plugins/executable_anyminio b/dot_anypaste-plugins/executable_anyminio
index 974d5cb..b89dbe2 100644
--- a/dot_anypaste-plugins/executable_anyminio
+++ b/dot_anypaste-plugins/executable_anyminio
@@ -8,9 +8,13 @@ case $1 in
upload)
d=$(date +%Y/%m/%d)
path="$anyminio_prefix/$d/$ap_human_name"
- "$anyminio_cli" cp "$ap_path" "$path"
- url=$($anyminio_cli ls --json "$path" | jq -r .url)
- echo >&2
+
+ "$anyminio_cli" cp "$ap_path" "$path" ||
+ { echo 'ERROR: Upload failed!' >&2; exit 1; }
+ url=$($anyminio_cli ls --json "$path" | jq -r .url) ||
+ {echo 'ERROR: Fetching object information failed!' >&2; exit 2; }
+
+ echo
echo "Link: $url"
echo "Direct: $url"
echo
diff --git a/dot_anypaste-plugins/executable_brpaste b/dot_anypaste-plugins/executable_brpaste
index 7d36ca4..bb5afb9 100644
--- a/dot_anypaste-plugins/executable_brpaste
+++ b/dot_anypaste-plugins/executable_brpaste
@@ -9,7 +9,7 @@ case $1 in
upload)
brpaste_id=$(curl -#fF "data=<$ap_path" "$brpaste_host") \
|| { echo 'ERROR: Upload failed!' >&2 && exit 1; }
- echo >&2
+ echo
echo "Link: $brpaste_host/$brpaste_id"
echo "Direct: $brpaste_host/raw/$brpaste_id"
echo