Skip to content

Commit

Permalink
rm 'q', fix no-param --install
Browse files Browse the repository at this point in the history
  • Loading branch information
mvayngrib committed Sep 5, 2017
1 parent 78652de commit 66593df
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
16 changes: 11 additions & 5 deletions cmd.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,22 +129,29 @@ function installShims (modulesToShim, done) {

var installLine = 'npm install --save '
shimPkgNames.forEach(function (name) {
if (allShims[name].indexOf('/') === -1) {
const version = allShims[name]
if (!version) return
if (version.indexOf('/') === -1) {
log('installing from npm', name)
installLine += name + '@' + allShims[name]
installLine += name + '@' + version
} else {
// github url
log('installing from github', name)
installLine += allShims[name].match(/([^\/]+\/[^\/]+)$/)[1]
installLine += version.match(/([^\/]+\/[^\/]+)$/)[1]
}

pkg.dependencies[name] = allShims[name]
pkg.dependencies[name] = version
installLine += ' '
})

fs.writeFile(pkgPath, JSON.stringify(pkg, null, 2), function (err) {
if (err) throw err

if (installLine.trim() === 'npm install --save') {
return finish()
}

log('installing:', installLine)
proc.execSync(installLine, {
cwd: process.cwd(),
env: process.env,
Expand All @@ -154,7 +161,6 @@ function installShims (modulesToShim, done) {
finish()
})

log('installing:', installLine)
function finish () {
copyShim(done)
}
Expand Down
2 changes: 1 addition & 1 deletion coreList.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ module.exports = [
"util",
"net",
"vm",
"q",
// note: tls doesn't have a shim
"tls"
]

0 comments on commit 66593df

Please sign in to comment.