@@ -129,22 +129,29 @@ function installShims (modulesToShim, done) {
129
129
130
130
var installLine = 'npm install --save '
131
131
shimPkgNames . forEach ( function ( name ) {
132
- if ( allShims [ name ] . indexOf ( '/' ) === - 1 ) {
132
+ const version = allShims [ name ]
133
+ if ( ! version ) return
134
+ if ( version . indexOf ( '/' ) === - 1 ) {
133
135
log ( 'installing from npm' , name )
134
- installLine += name + '@' + allShims [ name ]
136
+ installLine += name + '@' + version
135
137
} else {
136
138
// github url
137
139
log ( 'installing from github' , name )
138
- installLine += allShims [ name ] . match ( / ( [ ^ \/ ] + \/ [ ^ \/ ] + ) $ / ) [ 1 ]
140
+ installLine += version . match ( / ( [ ^ \/ ] + \/ [ ^ \/ ] + ) $ / ) [ 1 ]
139
141
}
140
142
141
- pkg . dependencies [ name ] = allShims [ name ]
143
+ pkg . dependencies [ name ] = version
142
144
installLine += ' '
143
145
} )
144
146
145
147
fs . writeFile ( pkgPath , JSON . stringify ( pkg , null , 2 ) , function ( err ) {
146
148
if ( err ) throw err
147
149
150
+ if ( installLine . trim ( ) === 'npm install --save' ) {
151
+ return finish ( )
152
+ }
153
+
154
+ log ( 'installing:' , installLine )
148
155
proc . execSync ( installLine , {
149
156
cwd : process . cwd ( ) ,
150
157
env : process . env ,
@@ -154,7 +161,6 @@ function installShims (modulesToShim, done) {
154
161
finish ( )
155
162
} )
156
163
157
- log ( 'installing:' , installLine )
158
164
function finish ( ) {
159
165
copyShim ( done )
160
166
}
0 commit comments