nvm-vanilla 1.0.22 → 1.0.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/index.js +7 -2
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -414,8 +414,8 @@ const use = async (baseDir, version, evalFlag = true) => {
|
|
|
414
414
|
|
|
415
415
|
env.PATH = list.join(path.delimiter);
|
|
416
416
|
|
|
417
|
-
env.NPM_CONFIG_PREFIX = prefixDir;
|
|
418
|
-
env.NPM_CONFIG_CACHE = cacheDir;
|
|
417
|
+
env.NPM_CONFIG_PREFIX = resetFlag ? '' : prefixDir;
|
|
418
|
+
env.NPM_CONFIG_CACHE = resetFlag ? '' : cacheDir;
|
|
419
419
|
|
|
420
420
|
// process.stderr.write('Now using node v' + version + '\n');
|
|
421
421
|
|
|
@@ -429,6 +429,11 @@ const use = async (baseDir, version, evalFlag = true) => {
|
|
|
429
429
|
// powershell
|
|
430
430
|
if (!process.env.SHELL) {
|
|
431
431
|
command = `$env:${key}="${value}"`;
|
|
432
|
+
} else if (process.platform === 'win32') {
|
|
433
|
+
command
|
|
434
|
+
.replace(/([\w+]):\\/g, (_, $1) => '/' + $1.toLowerCase() + '/')
|
|
435
|
+
.replace(/\\/g, '/')
|
|
436
|
+
.replace(/;/g, ':');
|
|
432
437
|
}
|
|
433
438
|
|
|
434
439
|
process.stdout.write(
|