swpm
swpm copied to clipboard
Global pins?
Prerequisites
Please answer the following questions for yourself before submitting an issue.
- [ ] I am running the latest version
- [x] I checked to make sure that this command request has not already been filed
Command to add
This is first a doubt, more than an addition. Does the pin command work only for current project or is there a way to "pin it globally"? If both are available, this would mean that having pnpm pinned globally would automatically work for any project. But if some project has pinned npm, then that would be preferred in it.
Expected Result
swpm --pin --global pnpm
mkdir someproject
cd someproject
swpm install # will use pnpm automatically
Context
I'm learning the tool first. If anything, this should help improve the docs.
Hi @bernardoadc there is no global pin command. But you can set a package manager by default with an environment variable.
I've created a new section on readme (and menu) to easy access.
https://github.com/deinsoftware/swpm#default
Let me know if this solves your doubt.
I will try to add soon a command to do this task, but I'm not sure if node.js support set environment variables on each OS.
It can't be created or updated OS environment variables directly with node.js (only read). https://nodejs.org/api/process.html#process_process_env
So, it will need to be set manually as described on the readme.
great @equiman ! Sorry for the late response.
I believe it should have a way of setting it with spawn (I think package cross-env does that), but setting the variable manually is equally fine!
Thanks for the recommendation, I will take a look before finishing a new feature about aliases.
https://www.npmjs.com/package/cross-env