File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change 1
1
'use strict' ;
2
2
3
+ var path = require ( 'path' ) ;
4
+ var fs = require ( 'fs' ) ;
3
5
var ghpages = require ( 'gh-pages' ) ;
4
6
var RSVP = require ( 'rsvp' ) ;
5
7
@@ -57,11 +59,17 @@ module.exports = {
57
59
'Travis build: https://travis-ci.org/' + process . env . TRAVIS_REPO_SLUG + '/builds/' + process . env . TRAVIS_BUILD_ID ;
58
60
}
59
61
62
+ var access = publish = RSVP . denodeify ( fs . access ) ;
60
63
var publish = RSVP . denodeify ( ghpages . publish ) ;
61
64
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!' ) ;
65
73
} ) ;
66
74
}
67
75
} ;
You can’t perform that action at this time.
0 commit comments