mirror of
https://github.com/ivuorinen/dotfiles.git
synced 2026-02-08 07:50:53 +00:00
fix(shell): use [[ instead of [ for conditional tests
Replace single brackets with double brackets in bash conditional expressions across 14 files (28 changes). All scripts use bash shebangs so [[ is safe everywhere (SonarCloud rule shelldre:S7688).
This commit is contained in:
@@ -54,7 +54,7 @@ remove_old_submodule() {
|
||||
local name="$1" path="$2"
|
||||
|
||||
# Remove working tree
|
||||
if [ -d "$path" ]; then
|
||||
if [[ -d "$path" ]]; then
|
||||
rm -rf "$path"
|
||||
_log "Removed $path"
|
||||
fi
|
||||
@@ -66,13 +66,13 @@ remove_old_submodule() {
|
||||
git config --remove-section "submodule.$path" 2> /dev/null || true
|
||||
|
||||
# Skip name-based cleanup if no submodule name provided
|
||||
[ -z "$name" ] && return 0
|
||||
[[ -z "$name" ]] && return 0
|
||||
|
||||
# Remove .git/config section keyed by name
|
||||
git config --remove-section "submodule.$name" 2> /dev/null || true
|
||||
|
||||
# Remove .git/modules/<name>/ cached repository
|
||||
if [ -d ".git/modules/$name" ]; then
|
||||
if [[ -d ".git/modules/$name" ]]; then
|
||||
rm -rf ".git/modules/$name"
|
||||
_log "Removed .git/modules/$name"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user