diff --git a/scripts/fix-history.sh b/scripts/fix-history.sh index 093dbff..183fe31 100755 --- a/scripts/fix-history.sh +++ b/scripts/fix-history.sh @@ -1122,17 +1122,19 @@ run_batch_cleanup() { for _repo in "${repos[@]}"; do pushd "$_repo" >/dev/null || continue local lt lb rt rb - lt=$(get_tmp_backup_tags); lb=$(get_tmp_backup_branches) - rt=$(get_remote_tmp_backup_tags); rb=$(get_remote_tmp_backup_branches) - local n=$(( $(count_lines "$lt") + $(count_lines "$lb") + $(count_lines "$rt") + $(count_lines "$rb") )) + lt=$(get_tmp_backup_tags) + lb=$(get_tmp_backup_branches) + rt=$(get_remote_tmp_backup_tags) + rb=$(get_remote_tmp_backup_branches) + local n=$(($(count_lines "$lt") + $(count_lines "$lb") + $(count_lines "$rt") + $(count_lines "$rb"))) if [[ $n -gt 0 ]]; then local key key=$(printf '%s' "$_repo" | md5sum | cut -c1-16) - printf '%s' "$lt" > "$tmp_dir/${key}.lt" - printf '%s' "$lb" > "$tmp_dir/${key}.lb" - printf '%s' "$rt" > "$tmp_dir/${key}.rt" - printf '%s' "$rb" > "$tmp_dir/${key}.rb" - printf '%s' "$_repo" > "$tmp_dir/${key}.path" + printf '%s' "$lt" >"$tmp_dir/${key}.lt" + printf '%s' "$lb" >"$tmp_dir/${key}.lb" + printf '%s' "$rt" >"$tmp_dir/${key}.rt" + printf '%s' "$rb" >"$tmp_dir/${key}.rb" + printf '%s' "$_repo" >"$tmp_dir/${key}.path" total_refs=$((total_refs + n)) print_info " $_repo (${n} ref(s))" [[ -n "$lt" ]] && echo "$lt" | sed 's/^/ local tag: /' @@ -1175,9 +1177,9 @@ run_batch_cleanup() { local repo_path repo_path=$(cat "$key_path") pushd "$repo_path" >/dev/null || continue - delete_local_tags "$(cat "$tmp_dir/${base}.lt" 2>/dev/null || true)" + delete_local_tags "$(cat "$tmp_dir/${base}.lt" 2>/dev/null || true)" delete_local_branches "$(cat "$tmp_dir/${base}.lb" 2>/dev/null || true)" - delete_remote_tags "$(cat "$tmp_dir/${base}.rt" 2>/dev/null || true)" + delete_remote_tags "$(cat "$tmp_dir/${base}.rt" 2>/dev/null || true)" delete_remote_branches "$(cat "$tmp_dir/${base}.rb" 2>/dev/null || true)" print_success " Cleaned: $repo_path" ((cleaned_repos++)) || true diff --git a/scripts/template-loading.sh b/scripts/template-loading.sh index 8d145c2..92e75e8 100755 --- a/scripts/template-loading.sh +++ b/scripts/template-loading.sh @@ -249,7 +249,7 @@ ensure_repo_labels() { local created=0 for def in "${label_defs[@]}"; do local name color desc - IFS=':' read -r name color desc <<< "$def" + IFS=':' read -r name color desc <<<"$def" if echo "$existing" | grep -qxF "$name"; then continue fi @@ -1431,13 +1431,13 @@ run_batch_update() { # If the user passed explicit paths that all lacked .git (likely a glob expansion like *), # offer to fall back to the current directory before giving up. local _had_explicit=false - [[ ${#POSITIONAL_ARGS[@]} -gt 1 || ( ${#POSITIONAL_ARGS[@]} -eq 1 && "${POSITIONAL_ARGS[0]}" != "." ) ]] \ + [[ ${#POSITIONAL_ARGS[@]} -gt 1 || (${#POSITIONAL_ARGS[@]} -eq 1 && "${POSITIONAL_ARGS[0]}" != ".") ]] \ && _had_explicit=true if [[ "$_had_explicit" == "true" && "${ASSUME_YES:-false}" != "true" ]]; then local _cwd_name _cwd_name=$(basename "$PWD") print_warning "None of the given paths contain a git repository." - read -rp "Did you mean to update the current folder '${_cwd_name}'? [Y/n]: " _fallback < /dev/tty + read -rp "Did you mean to update the current folder '${_cwd_name}'? [Y/n]: " _fallback /dev/null || { @@ -1512,7 +1513,8 @@ run_batch_update() { local is_member=false IFS=',' read -ra _members <<<"$members_list" for m in "${_members[@]}"; do - m="${m#"${m%%[! ]*}"}"; m="${m%"${m##*[! ]}"}" + m="${m#"${m%%[! ]*}"}" + m="${m%"${m##*[! ]}"}" if [[ "$m" == "$remote_owner" ]]; then is_member=true break @@ -1849,7 +1851,8 @@ run_batch_init() { local is_member=false IFS=',' read -ra _members <<<"$members_list" for m in "${_members[@]}"; do - m="${m#"${m%%[! ]*}"}"; m="${m%"${m##*[! ]}"}" + m="${m#"${m%%[! ]*}"}" + m="${m%"${m##*[! ]}"}" if [[ "$m" == "$remote_owner" ]]; then is_member=true break