Fix find_local_pkgset failing in directories with spaces#543
Open
nguyen-nexdor wants to merge 1 commit into
Open
Fix find_local_pkgset failing in directories with spaces#543nguyen-nexdor wants to merge 1 commit into
nguyen-nexdor wants to merge 1 commit into
Conversation
Unquoted $PWD and $HERE break the test expression and cd when the current path contains spaces, printing errors on every new shell: find_local_pkgset: line 11: [: `)' expected, found ... find_local_pkgset: line 15: cd: too many arguments Quote the variables so paths with spaces are handled correctly.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Opening a new shell in any directory whose path contains spaces (e.g.
~/Desktop/AI AUTOMATION WORKFLOW) prints these errors from gvm's shell init:Cause
$PWD(line 11) and$HERE(line 15) are unquoted, so paths with spaces are word-split inside the[ ... ]test expression and thecdcommand.Fix
Quote the variables. Verified by sourcing the function and running it from a directory with spaces in the path — no errors, correct exit status, and cwd is restored.
🤖 Generated with Claude Code