@@ -126,16 +126,15 @@ const copyWithPattern = (cwd, pattern, dest) =>
126
126
* @func fetchPackage
127
127
* @desc Fetches and saves packages from npm into node_modules and adds a reference in the package.json under dependencies
128
128
* @param {string } packageName - The package name
129
- * @param {string } [url] - A URL which will be used to fetch the package from
130
129
*/
131
- const fetchPackage = ( packageName , url ) =>
130
+ const fetchPackage = packageName =>
132
131
wrapAsync ( function * ( ) {
133
132
const useYarn = hasYarn ( ) ;
134
133
const pm = useYarn ? 'yarn' : 'npm' ;
135
134
const installCmd = useYarn ? 'add' : 'install' ;
136
135
try {
137
- if ( packageName || url ) {
138
- const cmd = yield spawn ( pm , [ installCmd , url || packageName ] ) ;
136
+ if ( packageName ) {
137
+ const cmd = yield spawn ( pm , [ installCmd , packageName ] ) ;
139
138
error ( cmd . stderr ) ;
140
139
}
141
140
} catch ( err ) {
@@ -150,10 +149,9 @@ const fetchPackage = (packageName, url) =>
150
149
* @func checkAndInstallPackage
151
150
* Checks whether a package for a given packageName is installed locally. If package cannot be found, fetch and install it
152
151
* @param {string } packageName - The package name
153
- * @param {string } [url] - A URL which will be used to fetch the package from
154
152
* @return {boolean }
155
153
*/
156
- const checkAndInstallPackage = ( packageName , url ) =>
154
+ const checkAndInstallPackage = packageName =>
157
155
wrapAsync ( function * ( ) {
158
156
try {
159
157
require . resolve ( packageName ) ;
@@ -162,7 +160,7 @@ const checkAndInstallPackage = (packageName, url) =>
162
160
debug (
163
161
`checkAndInstallPackage: ${ packageName } not installed. Fetching it now …`
164
162
) ;
165
- yield fetchPackage ( packageName , url ) ;
163
+ yield fetchPackage ( packageName ) ;
166
164
return false ;
167
165
}
168
166
} ) ;
0 commit comments