@@ -126,16 +126,15 @@ const copyWithPattern = (cwd, pattern, dest) =>
126126 * @func fetchPackage
127127 * @desc Fetches and saves packages from npm into node_modules and adds a reference in the package.json under dependencies
128128 * @param {string } packageName - The package name
129- * @param {string } [url] - A URL which will be used to fetch the package from
130129 */
131- const fetchPackage = ( packageName , url ) =>
130+ const fetchPackage = packageName =>
132131 wrapAsync ( function * ( ) {
133132 const useYarn = hasYarn ( ) ;
134133 const pm = useYarn ? 'yarn' : 'npm' ;
135134 const installCmd = useYarn ? 'add' : 'install' ;
136135 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 ] ) ;
139138 error ( cmd . stderr ) ;
140139 }
141140 } catch ( err ) {
@@ -150,10 +149,9 @@ const fetchPackage = (packageName, url) =>
150149 * @func checkAndInstallPackage
151150 * Checks whether a package for a given packageName is installed locally. If package cannot be found, fetch and install it
152151 * @param {string } packageName - The package name
153- * @param {string } [url] - A URL which will be used to fetch the package from
154152 * @return {boolean }
155153 */
156- const checkAndInstallPackage = ( packageName , url ) =>
154+ const checkAndInstallPackage = packageName =>
157155 wrapAsync ( function * ( ) {
158156 try {
159157 require . resolve ( packageName ) ;
@@ -162,7 +160,7 @@ const checkAndInstallPackage = (packageName, url) =>
162160 debug (
163161 `checkAndInstallPackage: ${ packageName } not installed. Fetching it now …`
164162 ) ;
165- yield fetchPackage ( packageName , url ) ;
163+ yield fetchPackage ( packageName ) ;
166164 return false ;
167165 }
168166 } ) ;
0 commit comments