Skip to content

Commit

Permalink
fix: dont add quotes on node global bin path on Windows
Browse files Browse the repository at this point in the history
need to wait for npm/cmd-shim#42
to be merged and publish a new version.

closes #316
  • Loading branch information
fengmk2 committed Dec 7, 2019
1 parent 9b6fe1b commit 7373eef
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/bin.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const chalk = require('chalk');
const debug = require('debug')('npminstall:bin');
const path = require('path');
const fs = require('mz/fs');
const cmdShim = require('cmd-shim');
const cmdShim = require('cmd-shim-hotfix');
const utils = require('./utils');

module.exports = bin;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"binary-mirror-config": "^1.19.0",
"bytes": "^3.1.0",
"chalk": "^2.4.2",
"cmd-shim": "^3.0.3",
"cmd-shim-hotfix": "^3.0.3",
"debug": "^4.1.1",
"destroy": "^1.0.4",
"fs-extra": "^7.0.1",
Expand Down
6 changes: 6 additions & 0 deletions test/fixtures/runscript-with-egg-doctools/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": "runscript-with-egg-doctools",
"dependencies": {
"egg-doctools": "2.9.0"
}
}
28 changes: 28 additions & 0 deletions test/runscript-with-egg-doctools.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
'use strict';

const assert = require('assert');
const path = require('path');
const runScript = require('runscript');
const readJSON = require('../lib/utils').readJSON;
const npminstall = require('./npminstall');
const helper = require('./helper');

describe('test/runscript-with-egg-doctools.test.js', () => {
const root = helper.fixtures('runscript-with-egg-doctools');
const cleanup = helper.cleanup(root);

beforeEach(cleanup);
afterEach(cleanup);

it('should runscript with egg-doctools bin', async () => {
await npminstall({
root,
});
const pkg = await readJSON(path.join(root, 'node_modules', 'egg-doctools', 'package.json'));
assert(pkg.name === 'egg-doctools');

const bin = path.join(root, 'node_modules', '.bin', 'doctools');
const stdio = await runScript(`${bin} -V`, { stdio: 'pipe' });
assert(stdio.stdout.toString().trim() === '2.9.0');
});
});

0 comments on commit 7373eef

Please sign in to comment.