Skip to content

Commit 7b881f1

Browse files
viankakrisnagaearon
authored andcommitted
move the link for deployment to the bottom (facebook#3736)
1 parent 7fd37d3 commit 7b881f1

File tree

1 file changed

+36
-38
lines changed

1 file changed

+36
-38
lines changed

packages/react-dev-utils/printHostingInstructions.js

Lines changed: 36 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,9 @@ function printHostingInstructions(
2626
printBaseMessage(buildFolder, publicPathname);
2727

2828
printDeployInstructions(publicUrl, hasDeployScript, useYarn);
29-
3029
} else if (publicPath !== '/') {
3130
// "homepage": "http://mywebsite.com/project"
3231
printBaseMessage(buildFolder, publicPath);
33-
3432
} else {
3533
// "homepage": "http://mywebsite.com"
3634
// or no homepage
@@ -39,40 +37,36 @@ function printHostingInstructions(
3937
printStaticServerInstructions(buildFolder, useYarn);
4038
}
4139
console.log();
40+
console.log('Find out more about deployment here:');
41+
console.log();
42+
console.log(` ${chalk.yellow('http://bit.ly/2vY88Kr')}`);
43+
console.log();
4244
}
4345

4446
function printBaseMessage(buildFolder, hostingLocation) {
45-
console.log(
46-
`The project was built assuming it is hosted at ${chalk.green(
47-
hostingLocation || 'the server root'
48-
)}.`
49-
);
50-
console.log(
51-
`You can control this with the ${chalk.green(
52-
'homepage'
53-
)} field in your ${chalk.cyan('package.json')}.`
54-
);
55-
56-
if (!hostingLocation) {
57-
console.log('For example, add this to build it for GitHub Pages:');
58-
console.log();
59-
60-
console.log(
61-
` ${chalk.green('"homepage"')} ${chalk.cyan(':')} ${chalk.green(
62-
'"http://myname.github.io/myapp"'
63-
)}${chalk.cyan(',')}`
64-
);
65-
}
47+
console.log(
48+
`The project was built assuming it is hosted at ${chalk.green(
49+
hostingLocation || 'the server root'
50+
)}.`
51+
);
52+
console.log(
53+
`You can control this with the ${chalk.green(
54+
'homepage'
55+
)} field in your ${chalk.cyan('package.json')}.`
56+
);
57+
58+
if (!hostingLocation) {
59+
console.log('For example, add this to build it for GitHub Pages:');
6660
console.log();
6761

6862
console.log(
69-
`The ${chalk.cyan(buildFolder)} folder is ready to be deployed.`
63+
` ${chalk.green('"homepage"')} ${chalk.cyan(':')} ${chalk.green(
64+
'"http://myname.github.io/myapp"'
65+
)}${chalk.cyan(',')}`
7066
);
71-
console.log()
72-
console.log('Find out more about deployment here:');
73-
console.log();
74-
console.log(` ${chalk.yellow('http://bit.ly/2vY88Kr')}`);
75-
console.log();
67+
}
68+
console.log();
69+
console.log(`The ${chalk.cyan(buildFolder)} folder is ready to be deployed.`);
7670
}
7771

7872
function printDeployInstructions(publicUrl, hasDeployScript, useYarn) {
@@ -88,20 +82,24 @@ function printDeployInstructions(publicUrl, hasDeployScript, useYarn) {
8882
}
8983
console.log();
9084

91-
console.log(`Add the following script in your ${chalk.cyan(
92-
'package.json'
93-
)}.`);
85+
console.log(
86+
`Add the following script in your ${chalk.cyan('package.json')}.`
87+
);
9488
console.log();
9589

9690
console.log(` ${chalk.dim('// ...')}`);
9791
console.log(` ${chalk.yellow('"scripts"')}: {`);
9892
console.log(` ${chalk.dim('// ...')}`);
99-
console.log(` ${chalk.yellow('"predeploy"')}: ${chalk.yellow(
100-
'"npm run build",'
101-
)}`);
102-
console.log(` ${chalk.yellow('"deploy"')}: ${chalk.yellow(
103-
'"gh-pages -d build"'
104-
)}`);
93+
console.log(
94+
` ${chalk.yellow('"predeploy"')}: ${chalk.yellow(
95+
'"npm run build",'
96+
)}`
97+
);
98+
console.log(
99+
` ${chalk.yellow('"deploy"')}: ${chalk.yellow(
100+
'"gh-pages -d build"'
101+
)}`
102+
);
105103
console.log(' }');
106104
console.log();
107105

0 commit comments

Comments
 (0)