Commit 11f09a16 authored by Sascha  Dens's avatar Sascha Dens Committed by Dan Abramov
Browse files

Extend --scripts-version to include .tar.gz format (#3725)

* Extend --scripts-version to include .tar.gz format

* Removal of debug console.log
parent 3a0b836b
Showing with 7 additions and 2 deletions
+7 -2
......@@ -85,6 +85,11 @@ const program = new commander.Command(packageJson.name)
'https://mysite.com/my-react-scripts-0.8.2.tgz'
)}`
);
console.log(
` - a .tar.gz archive: ${chalk.green(
'https://mysite.com/my-react-scripts-0.8.2.tar.gz'
)}`
);
console.log(
` It is not needed unless you specifically want to use a fork.`
);
......@@ -432,7 +437,7 @@ function extractStream(stream, dest) {
// Extract package name from tarball url or path.
function getPackageName(installPackage) {
if (installPackage.indexOf('.tgz') > -1) {
if (installPackage.match(/^.+\.(tgz|tar\.gz)$/)) {
return getTemporaryDirectory()
.then(obj => {
let stream;
......@@ -455,7 +460,7 @@ function getPackageName(installPackage) {
`Could not extract the package name from the archive: ${err.message}`
);
const assumedProjectName = installPackage.match(
/^.+\/(.+?)(?:-\d+.+)?\.tgz$/
/^.+\/(.+?)(?:-\d+.+)?\.(tgz|tar\.gz)$/
)[1];
console.log(
`Based on the filename, assuming it is "${chalk.cyan(
......
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