diff --git a/lib/clean/project.sh b/lib/clean/project.sh index 14adde7..c701f08 100644 --- a/lib/clean/project.sh +++ b/lib/clean/project.sh @@ -383,7 +383,6 @@ scan_purge_targets() { while IFS= read -r item; do # Check if we should abort (scanning file removed by Ctrl+C) if [[ ! -f "$stats_dir/purge_scanning" ]]; then - rm -f "$output_file.raw" return fi @@ -421,7 +420,6 @@ scan_purge_targets() { while IFS= read -r item; do # Check if we should abort (scanning file removed by Ctrl+C) if [[ ! -f "$stats_dir/purge_scanning" ]]; then - rm -f "$output_file.raw" return fi @@ -860,7 +858,7 @@ clean_project_artifacts() { # If we found project but still checking for monorepo above # (only stop if we're beyond reasonable depth) - local depth=$(echo "${current_dir#$HOME}" | LC_ALL=C tr -cd '/' | wc -c | tr -d ' ') + local depth=$(echo "${current_dir#"$HOME"}" | LC_ALL=C tr -cd '/' | wc -c | tr -d ' ') if [[ -n "$project_root" && $depth -lt 2 ]]; then break fi diff --git a/lib/core/common.sh b/lib/core/common.sh index 12fd1e7..d34e415 100755 --- a/lib/core/common.sh +++ b/lib/core/common.sh @@ -119,7 +119,7 @@ get_brew_cask_name() { # Path is room/token/version/App.app (can be directory or symlink) cask_match=$(find "$room" -maxdepth 3 -name "$app_bundle_name" 2> /dev/null | head -1 || echo "") if [[ -n "$cask_match" ]]; then - local relative="${cask_match#$room/}" + local relative="${cask_match#"$room"/}" echo "${relative%%/*}" return 0 fi @@ -131,7 +131,7 @@ get_brew_cask_name() { target=$(readlink "$app_path") for room in "/opt/homebrew/Caskroom" "/usr/local/Caskroom"; do if [[ "$target" == "$room/"* ]]; then - local relative="${target#$room/}" + local relative="${target#"$room"/}" echo "${relative%%/*}" return 0 fi