Skip to content

Commit a90f357

Browse files
committed
work in progress
1 parent 18e3e6d commit a90f357

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

deploy.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
'use strict';
22

3+
var path = require('path');
4+
var fs = require('fs');
35
var ghpages = require('gh-pages');
46
var RSVP = require('rsvp');
57

@@ -57,11 +59,17 @@ module.exports = {
5759
'Travis build: https://travis-ci.org/' + process.env.TRAVIS_REPO_SLUG + '/builds/' + process.env.TRAVIS_BUILD_ID;
5860
}
5961

62+
var access = publish = RSVP.denodeify(fs.access);
6063
var publish = RSVP.denodeify(ghpages.publish);
6164

62-
return publish(dir, options)
63-
.then(function(committed) {
64-
ui.write('Successfully published!\n');
65+
return access(dir, fs.F_OK)
66+
.catch(function(error) {
67+
ui.writeError('Dist folder does not exist. Can \'t publish anything. Run `ng build` first!');
68+
return RSVP.reject(error) ;
69+
})
70+
.then(publish(dir, options))
71+
.then(function() {
72+
ui.write('Successfully published!');
6573
});
6674
}
6775
};

0 commit comments

Comments
 (0)