Skip to content

Commit

Permalink
Fix CI errors
Browse files Browse the repository at this point in the history
  • Loading branch information
mrmckeb committed Sep 22, 2019
1 parent eea0627 commit eda43e2
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion packages/create-react-app/createReactApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,7 @@ function getInstallPackage(version, originalDirectory) {
function getTemplateInstallPackage(template, originalDirectory) {
let templateToInstall = 'create-react-app-template';
if (template) {
if (template.startsWith('file:')) {
if (template.match(/^file:/)) {
templateToInstall = `file:${path.resolve(
originalDirectory,
template.match(/^file:(.*)?$/)[1]
Expand Down
14 changes: 7 additions & 7 deletions packages/react-scripts/scripts/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,6 @@ module.exports = function(

if (fs.existsSync(templateJsonPath)) {
const templateDependencies = require(templateJsonPath).dependencies;
console.log(templateDependencies);
args = args.concat(
Object.keys(templateDependencies).map(key => {
return `${key}@${templateDependencies[key]}`;
Expand All @@ -170,7 +169,8 @@ module.exports = function(

// Install template dependencies, and react and react-dom if missing.
if ((!isReactInstalled(appPackage) || templateName) && args.length > 1) {
console.log(`Installing react and react-dom using ${command}...`);
console.log();
console.log(`Installing template dependencies using ${command}...`);
console.log();

const proc = spawn.sync(command, args, { stdio: 'inherit' });
Expand All @@ -184,11 +184,6 @@ module.exports = function(
verifyTypeScriptSetup();
}

if (tryGitInit(appPath)) {
console.log();
console.log('Initialized a git repository.');
}

// Remove template
console.log();
console.log(`Removing template package using ${command}...`);
Expand All @@ -202,6 +197,11 @@ module.exports = function(
return;
}

if (tryGitInit(appPath)) {
console.log();
console.log('Initialized a git repository.');
}

// Display the most elegant way to cd.
// This needs to handle an undefined originalDirectory for
// backward compatibility with old global-cli's.
Expand Down
4 changes: 4 additions & 0 deletions tasks/e2e-kitchensink-eject.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ set -x
# Go to root
cd ..
root_path=$PWD
# Set a Windows path for GitBash on Windows
if [ $AGENT_OS == 'Windows_NT' ]; then
root_path=$(cmd //c cd)
fi

if hash npm 2>/dev/null
then
Expand Down

0 comments on commit eda43e2

Please sign in to comment.