cleaned up bashisms
This commit is contained in:
@@ -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]')"
|
||||
|
||||
Reference in New Issue
Block a user