Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Meta
create-react-app
Commits
d9453703
Commit
d9453703
authored
8 years ago
by
Tom Conroy
Committed by
Joe Haddad
8 years ago
Browse files
Options
Download
Email Patches
Plain Diff
Allow --scripts-version to be a git url (#1570)
parent
2a8535b5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
packages/create-react-app/index.js
+5
-0
packages/create-react-app/index.js
with
5 additions
and
0 deletions
+5
-0
packages/create-react-app/index.js
100644 → 100755
+
5
-
0
View file @
d9453703
...
...
@@ -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
];
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment