Skip to content

Commit

Permalink
Support force & buildFromSource options in yarn (#140)
Browse files Browse the repository at this point in the history
  • Loading branch information
joaomoreno authored Apr 4, 2021
1 parent f6d0cee commit 8cb1ced
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
7 changes: 1 addition & 6 deletions bin.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

var path = require('path')
var fs = require('fs')
var whichPmRuns = require('which-pm-runs')
var napi = require('napi-build-utils')

var pkg = require(path.resolve('package.json'))
Expand Down Expand Up @@ -42,13 +41,9 @@ var opts = Object.assign({}, rc, { pkg: pkg, log: log })

if (napi.isNapiRuntime(rc.runtime)) napi.logUnsupportedVersion(rc.target, log)

var pm = whichPmRuns()
var isNpm = !pm || pm.name === 'npm'
var origin = util.packageOrigin(process.env, pkg)

if (!isNpm && /node_modules/.test(process.cwd())) {
// From yarn repository
} else if (opts.force) {
if (opts.force) {
log.warn('install', 'prebuilt binaries enforced with --force!')
log.warn('install', 'prebuilt binaries may be out of date!')
} else if (origin && origin.length > 4 && origin.substr(0, 4) === 'git+') {
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@
"rc": "^1.2.7",
"simple-get": "^3.0.3",
"tar-fs": "^2.0.0",
"tunnel-agent": "^0.6.0",
"which-pm-runs": "^1.0.0"
"tunnel-agent": "^0.6.0"
},
"devDependencies": {
"a-native-module": "^1.0.0",
Expand Down

0 comments on commit 8cb1ced

Please sign in to comment.