From b76ac934a2d738aaf8c103801c8dc7f80ba8cf3f Mon Sep 17 00:00:00 2001 From: Rifat Nabi Date: Thu, 17 Nov 2016 00:09:05 +0600 Subject: [PATCH] Fix global add linking issue (#1889) --- __tests__/commands/global.js | 2 ++ src/cli/commands/global.js | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/__tests__/commands/global.js b/__tests__/commands/global.js index dad6b36da3..358741c3ff 100644 --- a/__tests__/commands/global.js +++ b/__tests__/commands/global.js @@ -70,8 +70,10 @@ async function runGlobal( throw new Error(`${err && err.stack} \nConsole output:\n ${out}`); } } + test.concurrent('add without flag', (): Promise => { return runGlobal('add', {}, ['react-native-cli'], 'add-without-flag', async (config) => { assert.ok(await fs.exists(path.join(config.cwd, 'node_modules', 'react-native-cli'))); + assert.ok(await fs.exists(path.join(config.cwd, 'node_modules', '.bin', 'react-native'))); }); }); diff --git a/src/cli/commands/global.js b/src/cli/commands/global.js index 0716f99bab..93c6bd3180 100644 --- a/src/cli/commands/global.js +++ b/src/cli/commands/global.js @@ -32,7 +32,10 @@ class GlobalAdd extends Add { const path = require('path'); async function updateCwd(config: Config): Promise { - await config.init({cwd: config.globalFolder}); + await config.init({ + cwd: config.globalFolder, + binLinks: true, + }); } async function getBins(config: Config): Promise> {