diff --git a/addon/ng2/commands/github-pages-deploy.ts b/addon/ng2/commands/github-pages-deploy.ts
index 2c4803e5dc08..f53279238c97 100644
--- a/addon/ng2/commands/github-pages-deploy.ts
+++ b/addon/ng2/commands/github-pages-deploy.ts
@@ -162,12 +162,13 @@ module.exports = Command.extend({
if (file === '.gitignore'){
// don't overwrite the .gitignore file
return Promise.resolve();
- }
+ }
return fsCopy(path.join('dist', file), path.join('.', file))
})));
}
function updateBaseHref() {
+ if (options.userPage) return Promise.resolve();
let indexHtml = path.join(root, 'index.html');
return fsReadFile(indexHtml, 'utf8')
.then((data) => data.replace(//g, ``))
@@ -192,7 +193,8 @@ module.exports = Command.extend({
return execPromise('git remote -v')
.then((stdout) => {
let userName = stdout.match(/origin\s+(?:https:\/\/|git@)github\.com(?:\:|\/)([^\/]+)/m)[1].toLowerCase();
- ui.writeLine(chalk.green(`Deployed! Visit https://${userName}.github.io/${projectName}/`));
+ let url = `https://${userName}.github.io/${options.userPage ? '' : (projectName + '/')}`;
+ ui.writeLine(chalk.green(`Deployed! Visit ${url}`));
ui.writeLine('Github pages might take a few minutes to show the deployed site.');
});
}
diff --git a/tests/acceptance/github-pages-deploy.spec.js b/tests/acceptance/github-pages-deploy.spec.js
index 7f1f7d57ecfd..efee8e5d2014 100644
--- a/tests/acceptance/github-pages-deploy.spec.js
+++ b/tests/acceptance/github-pages-deploy.spec.js
@@ -106,7 +106,7 @@ describe('Acceptance: ng github-pages:deploy', function() {
let indexHtml = path.join(process.cwd(), 'index.html');
return fsReadFile(indexHtml, 'utf8');
})
- .then((data) => expect(data.search(``)).to.not.equal(-1));
+ .then((data) => expect(data.search('')).to.not.equal(-1));
});
it('should create branch if needed', function() {