diff options
author | zachir <zachir@librem.one> | 2025-08-30 09:55:12 -0500 |
---|---|---|
committer | zachir <zachir@librem.one> | 2025-08-30 09:55:12 -0500 |
commit | a062b9fd9bcba2bbae0ab65453c7ceddce67b871 (patch) | |
tree | 9cab6f4b737c9b386824f2458d7e55aaf970411b | |
parent | 1b94482d3b93a0ffbe3216765948a9c60b9d6a91 (diff) |
Shellcheck all the scripts
-rwxr-xr-x | install.sh | 9 | ||||
-rwxr-xr-x | slider | 4 |
2 files changed, 8 insertions, 5 deletions
@@ -31,7 +31,10 @@ while getopts "cdhsSu:" o; do case "${o}" in ;; s) ___USE_SSH=y ;; S) unset ___USE_SSH ;; - u) URL="$OPTARG" ;; + u) + SSH_BASE_URL="$OPTARG" + HTTP_BASE_URL="$OPTARG" + ;; *) printhelp ;; esac done @@ -42,7 +45,7 @@ clone_dir () { printf "%s already exists, but not as a dir; not adding.\n" "$1" else if [ -n "$2" ]; then - printf "Cloning %s %s using ssh; will be read-write\nNote: only my ssh key will clone it\n" "$1" + printf "Cloning %s using ssh; will be read-write\nNote: only my ssh key will clone it\n" "$1" git clone "$SSH_BASE_URL$1.git" "$1" else printf "Cloning %s using http; will be read-only\n" "$1" @@ -51,7 +54,7 @@ clone_dir () { fi } -echo "$SCRIPT_DIRS" | while read i; do +echo "$SCRIPT_DIRS" | while read -r i; do [ -z "$i" ] && continue clone_dir "$i" "$___USE_SSH" done @@ -10,7 +10,7 @@ # Application cache if not stated elsewhere. cache="${XDG_CACHE_HOME:-$HOME/.cache}/slider" -while getopts "hvrpi:c:a:o:d:f:t:e:x:" o; do case "${o}" in +while getopts "hvrpi:c:a:o:d:f:t:e:x:s:" o; do case "${o}" in c) bgc="$OPTARG" ;; t) fgc="$OPTARG" ;; i) file="$OPTARG" ;; @@ -65,7 +65,7 @@ if [ -n "${audio+x}" ]; then audio/*) ;; *) echo "That doesn't look like an audio file."; exit 1 ;; esac - totseconds="$(date '+%s' -d $(ffmpeg -i "$audio" 2>&1 | awk '/Duration/ {print $2}' | sed s/,//))" + totseconds="$(date '+%s' -d "$(ffmpeg -i "$audio" 2>&1 | awk '/Duration/ {print $2}' | sed s/,//)")" endtime="$((totseconds-seconds))" fi |