@@ -53,7 +53,7 @@ Generator.prototype.gitInit = function gitInit() {
53
53
54
54
this . log ( chalk . bold ( 'Initializing deployment repo' ) ) ;
55
55
this . mkdir ( 'dist' ) ;
56
- exec ( 'git init" ' , { cwd : 'dist' } , function ( err , stdout , stderr ) {
56
+ exec ( 'git init' , { cwd : 'dist' } , function ( err , stdout , stderr ) {
57
57
this . log ( stdout ) ;
58
58
done ( ) ;
59
59
} . bind ( this ) ) ;
@@ -64,15 +64,15 @@ Generator.prototype.gitRemoteCheck = function gitRemoteCheck() {
64
64
if ( this . abort || typeof this . dist_repo_url !== 'undefined' ) return ;
65
65
var done = this . async ( ) ;
66
66
67
- this . log ( chalk . bold ( "Checking for an existing git remote named 'openshift '..." ) ) ;
67
+ this . log ( chalk . bold ( "Checking for an existing git remote named '" + this . deployedName + " '...") ) ;
68
68
exec ( 'git remote -v' , { cwd : 'dist' } , function ( err , stdout , stderr ) {
69
69
var lines = stdout . split ( '\n' ) ;
70
70
var dist_repo = '' ;
71
71
this . log ( 'stdout: ' + stdout ) ;
72
72
if ( err && stderr . search ( 'DL is deprecated' ) === - 1 ) {
73
73
this . log . error ( err ) ;
74
74
} else {
75
- var repo_url_finder = / o p e n s h i f t [ ] * / ;
75
+ var repo_url_finder = new RegExp ( this . deployedName + " [ ]*" ) ;
76
76
lines . forEach ( function ( line ) {
77
77
if ( line . search ( repo_url_finder ) === 0 && dist_repo === '' ) {
78
78
var dist_repo_detailed = line . slice ( line . match ( repo_url_finder ) [ 0 ] . length ) ;
@@ -150,7 +150,7 @@ Generator.prototype.gitRemoteAdd = function gitRemoteAdd() {
150
150
var done = this . async ( ) ;
151
151
this . log ( chalk . bold ( "Adding remote repo url: " + this . dist_repo_url ) ) ;
152
152
153
- exec ( 'git remote add openshift ' + this . dist_repo_url , { cwd : 'dist' } , function ( err , stdout , stderr ) {
153
+ exec ( 'git remote add ' + this . deployedName + ' '+ this . dist_repo_url , { cwd : 'dist' } , function ( err , stdout , stderr ) {
154
154
if ( err ) {
155
155
this . log . error ( err ) ;
156
156
} else {
@@ -202,7 +202,7 @@ Generator.prototype.gitForcePush = function gitForcePush() {
202
202
var done = this . async ( ) ;
203
203
this . log ( chalk . bold ( "Uploading your initial application code.\n This may take " + chalk . cyan ( 'several minutes' ) + " depending on your connection speed..." ) ) ;
204
204
205
- exec ( 'git push -f openshift master' , { cwd : 'dist' } , function ( err , stdout , stderr ) {
205
+ exec ( 'git push -f ' + this . deployedName + ' master', { cwd : 'dist' } , function ( err , stdout , stderr ) {
206
206
if ( err ) {
207
207
this . log . error ( err ) ;
208
208
} else {
@@ -215,7 +215,7 @@ Generator.prototype.gitForcePush = function gitForcePush() {
215
215
this . log ( chalk . green ( '\nYou\'re all set! Your app should now be live at \n\t' + chalk . bold ( host_url ) ) ) ;
216
216
this . log ( chalk . yellow ( 'After app modification run\n\t' + chalk . bold ( 'grunt build' ) +
217
217
'\nThen enter the dist folder to commit these updates:\n\t' + chalk . bold ( 'cd dist && git commit -am "describe your changes here"' ) ) ) ;
218
- this . log ( chalk . green ( 'Finally, deploy your updated build to OpenShift with\n\t' + chalk . bold ( 'git push openshift master' ) ) ) ;
218
+ this . log ( chalk . green ( 'Finally, deploy your updated build to OpenShift with\n\t' + chalk . bold ( 'git push ' + this . deployedName + ' master') ) ) ;
219
219
this . openshift_host_url = host_url ;
220
220
}
221
221
done ( ) ;
0 commit comments