From 60da4f9613342261cf2a7156e1a486ae70316e2a Mon Sep 17 00:00:00 2001 From: Ryan Stelly Date: Fri, 14 Oct 2016 00:20:36 -0500 Subject: [PATCH 1/2] rename cmd link to cmd shim from .cmd.cmd to .cmd --- src/cli/commands/global.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/cli/commands/global.js b/src/cli/commands/global.js index fdd4f9dac3..55f80b9b52 100644 --- a/src/cli/commands/global.js +++ b/src/cli/commands/global.js @@ -114,6 +114,9 @@ async function initUpdateBins(config: Config, reporter: Reporter): Promise<() => const dest = path.join(binFolder, path.basename(src)); await fs.unlink(dest); await linkBin(src, dest); + if (process.platform === 'win32' && dest.indexOf('.cmd') != -1) { + await fs.rename(dest + '.cmd', dest); + } } }; } From 7e8398d9f79073550a424a8da9e11869aefaf23a Mon Sep 17 00:00:00 2001 From: Ryan Stelly Date: Thu, 29 Dec 2016 10:30:38 -0600 Subject: [PATCH 2/2] use !== instead of != --- src/cli/commands/global.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cli/commands/global.js b/src/cli/commands/global.js index 7438a44e81..15930d872a 100644 --- a/src/cli/commands/global.js +++ b/src/cli/commands/global.js @@ -143,7 +143,7 @@ async function initUpdateBins(config: Config, reporter: Reporter, flags: Object) try { await fs.unlink(dest); await linkBin(src, dest); - if (process.platform === 'win32' && dest.indexOf('.cmd') != -1) { + if (process.platform === 'win32' && dest.indexOf('.cmd') !== -1) { await fs.rename(dest + '.cmd', dest); } } catch (err) {