diff options
author | Florian Pritz <bluewind@xinu.at> | 2011-07-17 23:33:27 +0200 |
---|---|---|
committer | Florian Pritz <bluewind@xinu.at> | 2011-08-15 11:18:41 +0200 |
commit | 3e356c9539396c96d5e0645a3af551cdb538f54c (patch) | |
tree | d48d436c26e9f7011cb64291b6fe3da25d9f2b60 /fb.in | |
parent | 33fe9846fd0eca0c452bd6966c7a270ad389dae1 (diff) |
don't add error to the history
If $URL is not a URL the upload failed for some reason, so it should not
be added to the history.
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'fb.in')
-rw-r--r-- | fb.in | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -92,9 +92,11 @@ do_upload() { sed '$d' $TMPFILE >&2 URL=`tail -1 $TMPFILE`"$EXTENSION" echo $URL - CLIPBOARD="$CLIPBOARD $URL" - touch "$FBHIST" - echo "$URL :: $basefilename :: `date +%s` :: `stat -c %s -- "$file"`" >> "$FBHIST" + if echo $URL | grep -qE "^https?://"; then + CLIPBOARD="$CLIPBOARD $URL" + touch "$FBHIST" + echo "$URL :: $basefilename :: `date +%s` :: `stat -c %s -- "$file"`" >> "$FBHIST" + fi } read_stdin() { |