Skip to content

Fix find_local_pkgset failing in directories with spaces#543

Open
nguyen-nexdor wants to merge 1 commit into
moovweb:masterfrom
nguyen-nexdor:fix-find-local-pkgset-spaces
Open

Fix find_local_pkgset failing in directories with spaces#543
nguyen-nexdor wants to merge 1 commit into
moovweb:masterfrom
nguyen-nexdor:fix-find-local-pkgset-spaces

Conversation

@nguyen-nexdor

Copy link
Copy Markdown

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:

/home/user/.gvm/scripts/function/find_local_pkgset: line 11: [: `)' expected, found AUTOMATION
/home/user/.gvm/scripts/function/find_local_pkgset: line 15: cd: too many arguments

Cause

$PWD (line 11) and $HERE (line 15) are unquoted, so paths with spaces are word-split inside the [ ... ] test expression and the cd command.

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

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants