version-fox / vfox

A cross-platform and extendable version manager with support for Java, Node.js, Flutter, .Net & more
https://vfox.lhan.me
Apache License 2.0
2.85k stars 102 forks source link

Support environment variable settings to download mirror #33

Closed lovelope closed 9 months ago

lovelope commented 9 months ago

Version All OS macOS、Linux、Windows

Describe the bug Like nvm, users can set the nodejs download mirror location.

NVM_NODEJS_ORG_MIRROR=https://npm.taobao.org/mirrors/node

Instead of adding additional plugins. https://github.com/version-fox/vfox/issues/24

aooohan commented 9 months ago

I'm thinking about this too. Because vfox is extended in the form of a plugin. I'm thinking about which way is more friendly:

  1. Use environment variable settings as you mention.
  2. Use additional plugins to represent the corresponding mirrors.

Plan 1) needs to be a place to explain how to use, how to configure. Plan 2) program more intuitive, users do not need to care about how to configure, just need to install the corresponding plugin on it. But additional plugins are needed.

yimiaoxiehou commented 9 months ago

I like Plan 2). This tools not only for nodejs,i want't remember a lots of env args like (NODE_MIRROR, GOLANG_MIRROR, JDK_MIRROR).

yimiaoxiehou commented 9 months ago

i hope can use vfox available to list mirror plugins . it will implement this feature better. image

vfox available can show flutter and flutter-cn now. maybe can add vfox available -u cmd to refresh list by version-fox-plugins

yimiaoxiehou commented 9 months ago

i hope can use vfox available to list mirror plugins . it will implement this feature better. image

vfox available can show flutter and flutter-cn now. maybe can add vfox available -u cmd to refresh list by version-fox-plugins

em,vfox available can auto refresh by version-fox-plugins not need any arg。 😄 after my mirror plugin accept. it added in list. image

@lovelope now, you can use vfox add nodejs/npmmirror --alias nodejs to use https://cdn.npmmirror.com (aliyun mirror) as node download source

image

lovelope commented 9 months ago

LGTM

aooohan commented 9 months ago

Looking at it this way, the original option 2 is more reasonable. ;)