Skip to content

Commit e6c3810

Browse files
committed
gh-pages 0.3.1 works, gh-pages ^0.11.0 does not. let's figure out the issue
1 parent a90f357 commit e6c3810

File tree

3 files changed

+35
-8
lines changed

3 files changed

+35
-8
lines changed

README.md

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# angular-cli-ghpages
22

33
Angular CLI addon. Publish to any gh-pages branch on GitHub (or any other branch on any other remote).
4-
This is __NOT__ [IgorMinar/angular-cli-github-pages](https://github.com/IgorMinar/angular-cli-github-pages) - but inspired by it.
4+
This is __NOT__ [IgorMinar/angular-cli-github-pages](https://github.com/IgorMinar/angular-cli-github-pages).
55

66
## WHY?
77

88
[IgorMinar/angular-cli-github-pages](https://github.com/IgorMinar/angular-cli-github-pages) is fixed to the `gh-pages` branch of the same repository. In my oponion it is also trying to do too much.
99
In contrast to this, the [Angular2Buch/angular-cli-ghpages](https://github.com/Angular2Buch/angular-cli-ghpages) addon is much more simple. It pushes to any branch on any repository, by utilizing [tschaub/gh-pages](https://github.com/tschaub/gh-pages). Nothing more.
10-
This addon works perfectly on Travis-CI.
10+
This addon works great on Travis-CI.
1111

1212
## Installation & Setup
1313

@@ -31,10 +31,18 @@ Then execute `ng ghpages` in order to deploy it.
3131
Usage:
3232

3333
```sh
34-
ng build --environment=production
34+
ng build
3535
ng ghpages [OPTIONS]
3636
```
3737

38+
The following command runs on our Travis-CI:
39+
40+
```sh
41+
ng build --environment=production
42+
ng ghpages --repo=https://TheBuildbot:[email protected]/Angular2Buch/book-monkey2-public.git --name="The Buildbot" [email protected]
43+
```
44+
45+
3846
## Options
3947

4048
#### <a id="repo">--repo</a>
@@ -70,6 +78,13 @@ The name of the branch you'll be pushing to. The default uses GitHub's `gh-page
7078
If you are running the command in a repository without a `user.name` or `user.email` git config properties (or on a machine without these global config properties), you must provide user info before git allows you to commit. In this case provide both `name` and `email` string values to identify the committer.
7179

7280

81+
#### <a id="silent">--silent</a>
82+
* optional
83+
* default: `true` (boolean)
84+
85+
Suppress logging. With silent `true` log messages are suppressed and error messages are sanitized.
86+
87+
> This option should be used if the repository URL or other information passed to git commands is sensitive and should not be logged.
7388
7489

7590

deploy.js

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ module.exports = {
3636
type: String,
3737
default: undefined, // using gh-pages default -- see readme
3838
description: 'The git user-email which is associated with this commit'
39+
}, {
40+
name: 'silent',
41+
type: Boolean,
42+
default: false,
43+
description: 'Suppress console logging. This option should be used if the repository URL or other information passed to git commands is sensitive!'
3944
}],
4045
run: function(options, rawArgs) {
4146

@@ -51,7 +56,7 @@ module.exports = {
5156
}
5257
};
5358
options.dotfiles = true;
54-
options.silent = true; // hides credentials, if provided via repo URL
59+
options.logger = function(message) { ui.write(message + "\n"); }
5560

5661
if (process.env.TRAVIS) {
5762
options.message += '\n\n' +
@@ -62,14 +67,21 @@ module.exports = {
6267
var access = publish = RSVP.denodeify(fs.access);
6368
var publish = RSVP.denodeify(ghpages.publish);
6469

70+
6571
return access(dir, fs.F_OK)
6672
.catch(function(error) {
67-
ui.writeError('Dist folder does not exist. Can \'t publish anything. Run `ng build` first!');
73+
ui.writeError('Dist folder does not exist. Can \'t publish anything. Run `ng build` first!\n');
6874
return RSVP.reject(error) ;
6975
})
70-
.then(publish(dir, options))
7176
.then(function() {
72-
ui.write('Successfully published!');
77+
return publish(dir, options)
78+
})
79+
.then(function() {
80+
ui.write('Successfully published!\n');
81+
})
82+
.catch(function(error) {
83+
ui.writeError('An error occurred!\n');
84+
return RSVP.reject(error) ;
7385
});
7486
}
7587
};

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
],
3434
"license": "MIT",
3535
"dependencies": {
36-
"gh-pages": "^0.11.0",
36+
"gh-pages": "^0.3.1",
3737
"rsvp": "^3.0.14"
3838
},
3939
"keywords": ["ember-addon", "angular2", "angular-cli", "git", "gh-pages", "ghpages"]

0 commit comments

Comments
 (0)