cleaned up bashisms

This commit is contained in:
Luxferre
2026-07-27 20:33:44 +03:00
parent 3c952b7631
commit 9775b3edc4
9 changed files with 46 additions and 46 deletions
+3 -3
View File
@@ -86,9 +86,9 @@ cmd_upload() {
# delete individual remote files
cmd_delete() {
echo -n 'Confirm file deletion (y to confirm)? ';
printf 'Confirm file deletion (y to confirm)? ';
read -r resp
if [ "$resp" == "y" ]; then
if [ "$resp" = "y" ]; then
$REQCMD -H "$AUTH_HDR" -d "filenames[]=$1" ${APIROOT}/delete
else
echo 'Operation cancelled'
@@ -103,7 +103,7 @@ cmd_sync() {
projdir="$1"
[ -z "$1" ] && projdir="$(pwd)"
# iterate over the project directory
find "$projdir" \( ! -path '*/.*' \) -type f -printf '%P\n' | while read -r f; do
(cd "$projdir" && find . \( ! -path '*/.*' \) -type f | sed 's|^\./||') | while read -r f; do
fullpath=$(realpath "${projdir}/$f")
cursha="$(sha1sum -b "$fullpath" | cut -f 1 -d ' ')"
prevsha="$(printf '%s' "$flist" | jq -r --arg p "$f" '.[$p]')"