Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Access package name as env var in pnpm m exec #1553

Closed
vjpr opened this issue Dec 13, 2018 · 3 comments · Fixed by #1559
Closed

Access package name as env var in pnpm m exec #1553

vjpr opened this issue Dec 13, 2018 · 3 comments · Fixed by #1559
Assignees
Labels
area: monorepo Everything related to the pnpm workspace feature size: S type: feature

Comments

@vjpr
Copy link
Contributor

vjpr commented Dec 13, 2018

Just like lerna does: pnpm m exec -- echo \$PNPM_PKG_NAME

@zkochan zkochan added type: feature size: S area: monorepo Everything related to the pnpm workspace feature labels Dec 13, 2018
@zkochan zkochan self-assigned this Dec 14, 2018
zkochan added a commit that referenced this issue Dec 14, 2018
Current package name should be in env var called $PNPM_PKG_NAME
when running `pnpm m exec -- echo $PNPM_PKG_NAME

close #1553
@zkochan
Copy link
Member

zkochan commented Dec 14, 2018

Lerna names this env variable LERNA_PACKAGE_NAME, I think we should use the same convention, so PNPM_PACKAGE_NAME

zkochan added a commit that referenced this issue Dec 15, 2018
Current package name should be in env var called $PNPM_PKG_NAME
when running `pnpm m exec -- echo $PNPM_PACKAGE_NAME

close #1553
zkochan added a commit that referenced this issue Dec 18, 2018
Current package name should be in env var called $PNPM_PKG_NAME
when running `pnpm m exec -- echo $PNPM_PACKAGE_NAME

close #1553
@zkochan
Copy link
Member

zkochan commented Dec 21, 2018

🚢 2.22.0-0

@aleclarson
Copy link

aleclarson commented Oct 18, 2021

Any idea why $PNPM_PACKAGE_NAME would be an empty string for me? Probably doing the replacement before pnpm runs?

I tried \$PNPM_PACKAGE_NAME and wrapping in single quotes.

PS: I'm using oh-my-zsh

edit: My workaround 🤣

node -e "console.log(process.env.PNPM_PACKAGE_NAME)"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: monorepo Everything related to the pnpm workspace feature size: S type: feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants