cz-cli
cz-cli copied to clipboard
feat(adapter resolver): resolve '~' to HOME directory
This PR adds the support for ~ for the path property in the configuration file.
Use case
I install all my global dependencies with Mise to have the same environment on my different computers. This causes require("cz-emoji") to not work.
So I have to specify the path of the dependency manually.
{ "path": "/Users/arthur-fontaine/.local/share/mise/installs/npm-cz-emoji/latest/lib/node_modules/cz-emoji" }
This works, but as specified above, I want to have the same environment on my different computers, which have different usernames (on my computer 1, the home path is /Users/arthur-fontaine, and on my computer 2, this is /Users/arthurfontaine). So I tried to replace the absolute home path with ~ as follows.
{ "path": "~/.local/share/mise/installs/npm-cz-emoji/latest/lib/node_modules/cz-emoji" }
But it didn't work. This PR makes it work!