cz-cli icon indicating copy to clipboard operation
cz-cli copied to clipboard

feat(adapter resolver): resolve '~' to HOME directory

Open arthur-fontaine opened this issue 5 months ago • 0 comments

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!

arthur-fontaine avatar Aug 27 '25 08:08 arthur-fontaine