Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always use PROJECT_NAME, even for user and org pages #384

Merged
merged 2 commits into from
Jan 9, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions lib/publish-gh-pages.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ const USE_SSH = process.env.USE_SSH;
// github.io indicates organization repos that deploy via master. All others use gh-pages.
const DEPLOYMENT_BRANCH =
PROJECT_NAME.indexOf('.github.io') !== -1 ? 'master' : 'gh-pages';
const PROJECT_PATH =
PROJECT_NAME.indexOf('.github.io') !== -1 ? '' : PROJECT_NAME;

if (!ORGANIZATION_NAME) {
shell.echo(
Expand Down Expand Up @@ -109,7 +107,7 @@ shell.exec('git rm -rf .');

shell.cd('../..');

fromPath = path.join('build', PROJECT_PATH, '/');
fromPath = path.join('build', `${PROJECT_NAME}`);
toPath = path.join('build', `${PROJECT_NAME}-${DEPLOYMENT_BRANCH}`);
// In github.io case, project is deployed to root. Need to not recursively
// copy the deployment-branch to be.
Expand Down Expand Up @@ -152,7 +150,7 @@ fs.copy(
} else if (commitResults.code === 0) {
// The commit might return a non-zero value when site is up to date.
shell.echo(
`Website is live at: https://${ORGANIZATION_NAME}.github.io/${PROJECT_PATH}`
`Website is live at: https://${ORGANIZATION_NAME}.github.io/${PROJECT_NAME}`
);
shell.exit(0);
}
Expand Down