Skip to content

Commit 66593df

Browse files
committed
rm 'q', fix no-param --install
1 parent 78652de commit 66593df

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

cmd.js

+11-5
Original file line numberDiff line numberDiff line change
@@ -129,22 +129,29 @@ function installShims (modulesToShim, done) {
129129

130130
var installLine = 'npm install --save '
131131
shimPkgNames.forEach(function (name) {
132-
if (allShims[name].indexOf('/') === -1) {
132+
const version = allShims[name]
133+
if (!version) return
134+
if (version.indexOf('/') === -1) {
133135
log('installing from npm', name)
134-
installLine += name + '@' + allShims[name]
136+
installLine += name + '@' + version
135137
} else {
136138
// github url
137139
log('installing from github', name)
138-
installLine += allShims[name].match(/([^\/]+\/[^\/]+)$/)[1]
140+
installLine += version.match(/([^\/]+\/[^\/]+)$/)[1]
139141
}
140142

141-
pkg.dependencies[name] = allShims[name]
143+
pkg.dependencies[name] = version
142144
installLine += ' '
143145
})
144146

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

150+
if (installLine.trim() === 'npm install --save') {
151+
return finish()
152+
}
153+
154+
log('installing:', installLine)
148155
proc.execSync(installLine, {
149156
cwd: process.cwd(),
150157
env: process.env,
@@ -154,7 +161,6 @@ function installShims (modulesToShim, done) {
154161
finish()
155162
})
156163

157-
log('installing:', installLine)
158164
function finish () {
159165
copyShim(done)
160166
}

coreList.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,6 @@ module.exports = [
2727
"util",
2828
"net",
2929
"vm",
30-
"q",
30+
// note: tls doesn't have a shim
3131
"tls"
3232
]

0 commit comments

Comments
 (0)