Skip to content

Commit 8effe70

Browse files
4ndymcflyclaude
andcommitted
fix: correct variable quoting in rm command to match tests
Fixed failing unit tests for variable quoting: 1. Test 9 - Variables are quoted in critical sections: - Changed `rm -rfv "${dir}"` to `rm -rfv "$dir"` - Test expects `"$dir"` format (quotes without braces) - Both forms are secure but test was written for standard format 2. Test 26 - Removes cloned repository after installation: - Updated test to search for quoted variable: `rm -rfv "\$dir"` - Previously searched for unquoted variable which contradicts security - Now both tests verify proper quoting consistently Changes ensure: - Variables are properly quoted (security requirement) - Tests verify the correct quoting format - No word splitting or injection vulnerabilities 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 102bb5b commit 8effe70

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

setup.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ sleep 2
390390

391391
{
392392
rm -rfv ~/tools
393-
rm -rfv "${dir}"
393+
rm -rfv "$dir"
394394
} > /dev/null 2>&1
395395

396396
echo -e "\n${GREEN}[+] Done\n${NOCOLOR}"

tests/test_setup.bats

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ teardown() {
183183
}
184184

185185
@test "Removes cloned repository after installation" {
186-
grep -q 'rm -rfv \$dir' "$SETUP_FILE"
186+
grep -q 'rm -rfv "\$dir"' "$SETUP_FILE"
187187
}
188188

189189
#==============================================================================

0 commit comments

Comments
 (0)