Match postinstall skills scope to npm install context#54
Merged
Conversation
… context Use npm_config_global to detect whether the package was installed globally (npm i -g) or as a project dependency, and pass the matching scope flag to cio skills install.
npm runs postinstall with cwd inside node_modules, not the project root. Use INIT_CWD (set by npm to the original working directory) so --project installs skills into the actual project directory.
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.
Summary
--globaltocio skills installwhen installed vianpm i -g(global)--projectwhen installed as a project dependency (npm i @customerio/cli)npm_config_globalenv var, which npm sets to"true"during global installsPreviously the postinstall relied on the CLI's non-TTY fallback (which defaults to global). This makes the intent explicit and enables project-scoped installs for npm scripts usage.
Test plan
npm_config_globalis"true"duringnpm i -gnpm i -g @customerio/cli→ should install skills globally (~/.claude/skills/)npm i @customerio/cliin a project → should install skills in the project (./.claude/skills/)