mirror of
https://github.com/tw93/Mole.git
synced 2026-02-12 09:23:31 +00:00
Fixed the ShellCheck warning
This commit is contained in:
@@ -383,7 +383,6 @@ scan_purge_targets() {
|
|||||||
while IFS= read -r item; do
|
while IFS= read -r item; do
|
||||||
# Check if we should abort (scanning file removed by Ctrl+C)
|
# Check if we should abort (scanning file removed by Ctrl+C)
|
||||||
if [[ ! -f "$stats_dir/purge_scanning" ]]; then
|
if [[ ! -f "$stats_dir/purge_scanning" ]]; then
|
||||||
rm -f "$output_file.raw"
|
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -421,7 +420,6 @@ scan_purge_targets() {
|
|||||||
while IFS= read -r item; do
|
while IFS= read -r item; do
|
||||||
# Check if we should abort (scanning file removed by Ctrl+C)
|
# Check if we should abort (scanning file removed by Ctrl+C)
|
||||||
if [[ ! -f "$stats_dir/purge_scanning" ]]; then
|
if [[ ! -f "$stats_dir/purge_scanning" ]]; then
|
||||||
rm -f "$output_file.raw"
|
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -860,7 +858,7 @@ clean_project_artifacts() {
|
|||||||
|
|
||||||
# If we found project but still checking for monorepo above
|
# If we found project but still checking for monorepo above
|
||||||
# (only stop if we're beyond reasonable depth)
|
# (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
|
if [[ -n "$project_root" && $depth -lt 2 ]]; then
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -119,7 +119,7 @@ get_brew_cask_name() {
|
|||||||
# Path is room/token/version/App.app (can be directory or symlink)
|
# 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 "")
|
cask_match=$(find "$room" -maxdepth 3 -name "$app_bundle_name" 2> /dev/null | head -1 || echo "")
|
||||||
if [[ -n "$cask_match" ]]; then
|
if [[ -n "$cask_match" ]]; then
|
||||||
local relative="${cask_match#$room/}"
|
local relative="${cask_match#"$room"/}"
|
||||||
echo "${relative%%/*}"
|
echo "${relative%%/*}"
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
@@ -131,7 +131,7 @@ get_brew_cask_name() {
|
|||||||
target=$(readlink "$app_path")
|
target=$(readlink "$app_path")
|
||||||
for room in "/opt/homebrew/Caskroom" "/usr/local/Caskroom"; do
|
for room in "/opt/homebrew/Caskroom" "/usr/local/Caskroom"; do
|
||||||
if [[ "$target" == "$room/"* ]]; then
|
if [[ "$target" == "$room/"* ]]; then
|
||||||
local relative="${target#$room/}"
|
local relative="${target#"$room"/}"
|
||||||
echo "${relative%%/*}"
|
echo "${relative%%/*}"
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user