Skip to content

Commit

Permalink
Allow --scripts-version to be a git url (#1570)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomconroy authored and Timer committed Feb 23, 2017
1 parent bf0c02e commit 321f8b4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/create-react-app/index.js
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down

0 comments on commit 321f8b4

Please sign in to comment.