EqualMa / gitpkg

use a sub directory of a github repo as yarn / npm dependency directly
https://gitpkg.vercel.app
315 stars 19 forks source link

Shielding the escape of some special symbols #7

Closed Unbinilium closed 4 years ago

Unbinilium commented 4 years ago

It's safer to add a single quotation mark before and after the generated URL, here's why: -$ npm install https://gitpkg.now.sh/vuejs/vuepress/packages/vuepress?master -zsh: no matches found: https://gitpkg.now.sh/vuejs/vuepress/packages/vuepress?master

Then this would be work perfectly: -$ npm install 'https://gitpkg.now.sh/vuejs/vuepress/packages/vuepress?master'

vercel[bot] commented 4 years ago

This pull request is being automatically deployed with ZEIT Now (learn more). To see the status of your deployment, click on the icon next to each commit.

EqualMa commented 4 years ago

Thanks for your contribution!

I agree with you, but I think this should be done in install-command.js, where we get the install command, rather than where we get the apiUrl.

I will make another pull request to fix this issue. Anyway, thanks for pointing out the problem!