Skip to content

Commit

Permalink
Extend --scripts-version to include .tar.gz format (#3725)
Browse files Browse the repository at this point in the history
* Extend --scripts-version to include .tar.gz format

* Removal of debug console.log
  • Loading branch information
SaschaDens authored and gaearon committed Jan 9, 2018
1 parent 3a0b836 commit 11f09a1
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions packages/create-react-app/createReactApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.`
);
Expand Down Expand Up @@ -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;
Expand All @@ -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(
Expand Down

0 comments on commit 11f09a1

Please sign in to comment.