mirror of
https://github.com/ivuorinen/dotfiles.git
synced 2026-02-08 07:50:53 +00:00
fix(shell): add explicit return statements to functions
Add return 0 as the last statement in ~46 shell functions across 17 files that previously relied on implicit return codes (SonarCloud rule shelldre:S7682).
This commit is contained in:
@@ -20,6 +20,7 @@ check_required_tools()
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
return 0
|
||||
}
|
||||
|
||||
clone_or_update_repo()
|
||||
@@ -34,6 +35,7 @@ clone_or_update_repo()
|
||||
git -C "$PBB_TEMP_DIR" pull -q \
|
||||
&& msgr yay "Updated $PBB_GIT"
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
prepare_cheat_dest()
|
||||
@@ -46,6 +48,7 @@ prepare_cheat_dest()
|
||||
fi
|
||||
|
||||
echo "$cheat_dest"
|
||||
return 0
|
||||
}
|
||||
|
||||
# Processes chapter files from the pure-bash-bible repository and generates or updates corresponding cheat sheets.
|
||||
@@ -89,6 +92,7 @@ process_chapters()
|
||||
printf '%s\n%b%s\n%s' "---" "$metadata" "---" "$(cat "$cheat_file")" > "$cheat_file"
|
||||
fi
|
||||
done
|
||||
return 0
|
||||
}
|
||||
|
||||
main()
|
||||
@@ -96,6 +100,7 @@ main()
|
||||
check_required_tools
|
||||
clone_or_update_repo
|
||||
process_chapters
|
||||
return 0
|
||||
}
|
||||
|
||||
main "$@"
|
||||
|
||||
Reference in New Issue
Block a user