Skip to content

Commit

Permalink
Fix lint and remove shelljs (replaced with cross-spawn)
Browse files Browse the repository at this point in the history
  • Loading branch information
SBoudrias committed May 13, 2018
1 parent 8b620aa commit be8abde
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 24 deletions.
5 changes: 2 additions & 3 deletions lib/resolver.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
'use strict';
const path = require('path');
const fs = require('fs');
const os = require('os');
const _ = require('lodash');
const globby = require('globby');
const debug = require('debug')('yeoman:environment');
Expand Down Expand Up @@ -146,9 +145,9 @@ resolver.getNpmPaths = function () {
// Yarn has a command to get the directory of global modules:
// $ yarn global dir
// > '.../global\n'
const testYarn = spawn.sync('yarn', ['global', 'dir'], { encoding: 'utf8' });
const testYarn = spawn.sync('yarn', ['global', 'dir'], {encoding: 'utf8'});
if (!testYarn.error) {
paths.push(path.resolve(testYarn.stdout.strip(), '../link/');
paths.push(path.resolve(testYarn.stdout.trim(), '../link/'));
}

// Adds support for generator resolving when yeoman-generator has been linked
Expand Down
45 changes: 30 additions & 15 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@
"mocha": "^5.1.1",
"nsp": "^3.2.1",
"nyc": "^11.7.3",
"shelljs": "^0.8.2",
"sinon": "^5.0.7",
"sinon-test": "^2.1.3",
"xo": "^0.18.1",
Expand Down
10 changes: 5 additions & 5 deletions test/resolver.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
const fs = require('fs');
const path = require('path');
const assert = require('assert');
const shell = require('shelljs');
const spawn = require('cross-spawn');
const Environment = require('../lib/environment');

const globalLookupTest = process.env.NODE_PATH ? it : xit;
Expand All @@ -17,9 +17,9 @@ describe('Environment Resolver', function () {
before(function () {
this.projectRoot = path.join(__dirname, 'fixtures/lookup-project');
process.chdir(this.projectRoot);
shell.exec('npm install --no-package-lock', {silent: true});
shell.exec('npm install generator-jquery --no-package-lock', {silent: true});
shell.exec('npm install -g generator-dummytest generator-dummy --no-package-lock', {silent: true});
spawn.sync('npm', ['install', '--no-package-lock']);
spawn.sync('npm', ['install', 'generator-jquery', '--no-package-lock']);
spawn.sync('npm', ['install', '-g', 'generator-dummytest', 'generator-dummy', '--no-package-lock']);

fs.symlinkSync(
path.resolve('../generator-extend'),
Expand Down Expand Up @@ -87,7 +87,7 @@ describe('Environment Resolver', function () {
before(function () {
this.projectSubRoot = path.join(this.projectRoot, 'subdir');
process.chdir(this.projectSubRoot);
shell.exec('npm install --no-package-lock', {silent: true});
spawn.sync('npm', ['install', '--no-package-lock']);
});

beforeEach(function () {
Expand Down

0 comments on commit be8abde

Please sign in to comment.