diff --git a/package.json b/package.json index f90bdc4..c463f43 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,6 @@ "@oclif/plugin-not-found": "^1.0.4", "debug": "^3.1.0", "fixpack": "^2.3.1", - "has-yarn": "^1.0.0", "lodash": "^4.17.5", "nps-utils": "^1.5.0", "sort-pjson": "^1.0.2", diff --git a/src/generators/app.ts b/src/generators/app.ts index f8a369b..febaa52 100644 --- a/src/generators/app.ts +++ b/src/generators/app.ts @@ -1,19 +1,24 @@ // tslint:disable no-floating-promises // tslint:disable no-console +import {execSync} from 'child_process' import * as fs from 'fs' import * as _ from 'lodash' import * as path from 'path' import * as Generator from 'yeoman-generator' import yosay = require('yosay') -const hasYarn = require('has-yarn')() const nps = require('nps-utils') const sortPjson = require('sort-pjson') const fixpack = require('fixpack') const debug = require('debug')('generator-oclif') const {version} = require('../../package.json') +let hasYarn = false +try { + execSync('yarn -v') + hasYarn = true +} catch {} // function stringToArray(s: string) { // const keywords: string[] = []