Commit d9453703 authored by Tom Conroy's avatar Tom Conroy Committed by Joe Haddad
Browse files

Allow --scripts-version to be a git url (#1570)

parent 2a8535b5
Showing with 5 additions and 0 deletions
+5 -0
......@@ -212,6 +212,11 @@ function getPackageName(installPackage) {
// The package name could be with or without semver version, e.g. react-scripts-0.2.0-alpha.1.tgz
// However, this function returns package name only without semver version.
return installPackage.match(/^.+\/(.+?)(?:-\d+.+)?\.tgz$/)[1];
} else if (installPackage.indexOf('git+') === 0) {
// Pull package name out of git urls e.g:
// git+https://github.com/mycompany/react-scripts.git
// git+ssh://github.com/mycompany/react-scripts.git#v1.2.3
return installPackage.match(/([^\/]+)\.git(#.*)?$/)[1];
} else if (installPackage.indexOf('@') > 0) {
// Do not match @scope/ when stripping off @version or @tag
return installPackage.charAt(0) + installPackage.substr(1).split('@')[0];
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment