File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed
packages/create-react-app Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -212,6 +212,11 @@ function getPackageName(installPackage) {
212212 // The package name could be with or without semver version, e.g. react-scripts-0.2.0-alpha.1.tgz
213213 // However, this function returns package name only without semver version.
214214 return installPackage . match ( / ^ .+ \/ ( .+ ?) (?: - \d + .+ ) ? \. t g z $ / ) [ 1 ] ;
215+ } else if ( installPackage . indexOf ( 'git+' ) === 0 ) {
216+ // Pull package name out of git urls e.g:
217+ // git+https://github.com/mycompany/react-scripts.git
218+ // git+ssh://github.com/mycompany/react-scripts.git#v1.2.3
219+ return installPackage . match ( / ( [ ^ \/ ] + ) \. g i t ( # .* ) ? $ / ) [ 1 ] ;
215220 } else if ( installPackage . indexOf ( '@' ) > 0 ) {
216221 // Do not match @scope / when stripping off @version or @tag
217222 return installPackage . charAt ( 0 ) + installPackage . substr ( 1 ) . split ( '@' ) [ 0 ] ;
You can’t perform that action at this time.
0 commit comments