commit 98dd5aa305feb86d0ecb6e5f6b0c578519610382 parent 2f494a1864c6a98c90c4863c29d2a1fd94eab116 Author: Anders Damsgaard <anders@adamsgaard.dk> Date: Fri, 22 Nov 2019 09:41:11 +0100 Fix minor syntax issues Diffstat:
M | .local/bin/upload | | | 16 | ++++++++-------- |
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/.local/bin/upload b/.local/bin/upload @@ -94,9 +94,9 @@ upload_file() { if [ "$verbose" = 1 ]; then echo msg="Uploaded to $url (copied to clipboard)" - printf "%s\n" "$msg" + printf "%s\\n" "$msg" else - printf "%s\n" "$url" + printf "%s\\n" "$url" fi [ "$notify" = 1 ] && notify-send "$msg" @@ -109,11 +109,11 @@ upload_file() { download_file() { url="https://$host/files_nonpub/$1" - if type -v hurl >/dev/null 2>&1; then - hurl "$url" > ./$1 - elif type -v curl >/dev/null 2>&1; then + if command -v hurl >/dev/null 2>&1; then + hurl "$url" > ./"$1" + elif command -v curl >/dev/null 2>&1; then curl --fail -OL "$url" - elif type -v wget >/dev/null 2>&1; then + elif command -v wget >/dev/null 2>&1; then wget "$url" else die 'Error: no download program found' @@ -122,11 +122,11 @@ download_file() { } delete_file() { - ssh "$user"@"$host" "rm ${remotedir}/$1" + ssh "$user"@"$host" "rm '${remotedir}/$1'" } list_uploads() { - ssh "$user"@"$host" "ls -lah ${remotedir}/" + ssh "$user"@"$host" "ls -lah '${remotedir}/'" } die() {