Skip to content

Commit 6e2c196

Browse files
committed
chore(e2e): create repo pushes master branch
1 parent 53c7a96 commit 6e2c196

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

addon/ng2/commands/github-pages-deploy.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,8 @@ module.exports = Command.extend({
128128
return execPromise('git remote -v')
129129
.then(function(stdout) {
130130
if (!/origin\s+(https:\/\/|git@)github\.com/m.test(stdout)) {
131-
return createGithubRepoTask.run(createGithubRepoOptions);
131+
return createGithubRepoTask.run(createGithubRepoOptions)
132+
.then(() => execPromise(`git push -u origin ${initialBranch}`));
132133
}
133134
});
134135
}
@@ -175,7 +176,6 @@ module.exports = Command.extend({
175176
function printProjectUrl() {
176177
return execPromise('git remote -v')
177178
.then((stdout) => {
178-
179179
let userName = stdout.match(/origin\s+(?:https:\/\/|git@)github\.com(?:\:|\/)([^\/]+)/m)[1].toLowerCase();
180180
ui.writeLine(chalk.green(`Deployed! Visit https://${userName}.github.io/${projectName}/`));
181181
ui.writeLine('Github pages might take a few minutes to show the deployed site.');
@@ -184,6 +184,7 @@ module.exports = Command.extend({
184184

185185
function failGracefully(error) {
186186
if (error && (/git clean/.test(error.message) || /Permission denied/.test(error.message))) {
187+
ui.writeLine(error.message);
187188
let msg = 'There was a permissions error during git file operations, please close any open project files/folders and try again.';
188189
msg += `\nYou might also need to return to the ${initialBranch} branch manually.`;
189190
return Promise.reject(new SilentError(msg));

tests/acceptance/github-pages-deploy.spec.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ describe('Acceptance: ng github-pages:deploy', function() {
142142
.addExecSuccess('git rev-parse --abbrev-ref HEAD', initialBranch)
143143
.addExecSuccess('git remote -v', noRemote)
144144
.addExecSuccess(`git remote add origin git@github.com:${username}/${project}.git`)
145+
.addExecSuccess(`git push -u origin ${initialBranch}`)
145146
.addExecSuccess(`git checkout ${branch}`)
146147
.addExecSuccess('git add .')
147148
.addExecSuccess(`git commit -m "${message}"`)

0 commit comments

Comments
 (0)