Skip to content

Commit

Permalink
Fix global add linking issue (#1889)
Browse files Browse the repository at this point in the history
  • Loading branch information
torifat authored and bestander committed Nov 16, 2016
1 parent 1c76213 commit b76ac93
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions __tests__/commands/global.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,10 @@ async function runGlobal(
throw new Error(`${err && err.stack} \nConsole output:\n ${out}`);
}
}

test.concurrent('add without flag', (): Promise<void> => {
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')));
});
});
5 changes: 4 additions & 1 deletion src/cli/commands/global.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ class GlobalAdd extends Add {
const path = require('path');

async function updateCwd(config: Config): Promise<void> {
await config.init({cwd: config.globalFolder});
await config.init({
cwd: config.globalFolder,
binLinks: true,
});
}

async function getBins(config: Config): Promise<Set<string>> {
Expand Down

0 comments on commit b76ac93

Please sign in to comment.