1
0
mirror of https://github.com/tw93/Mole.git synced 2026-02-04 12:41:46 +00:00

Fixed the ShellCheck warning

This commit is contained in:
Tw93
2026-01-13 16:54:10 +08:00
parent 3a05db5e1d
commit 8ec7663a70
2 changed files with 3 additions and 5 deletions

View File

@@ -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

View File

@@ -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