@@ -53,7 +53,7 @@ Generator.prototype.gitInit = function gitInit() {
5353
5454 this . log ( chalk . bold ( 'Initializing deployment repo' ) ) ;
5555 this . mkdir ( 'dist' ) ;
56- exec ( 'git init" ' , { cwd : 'dist' } , function ( err , stdout , stderr ) {
56+ exec ( 'git init' , { cwd : 'dist' } , function ( err , stdout , stderr ) {
5757 this . log ( stdout ) ;
5858 done ( ) ;
5959 } . bind ( this ) ) ;
@@ -64,15 +64,15 @@ Generator.prototype.gitRemoteCheck = function gitRemoteCheck() {
6464 if ( this . abort || typeof this . dist_repo_url !== 'undefined' ) return ;
6565 var done = this . async ( ) ;
6666
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 + " '...") ) ;
6868 exec ( 'git remote -v' , { cwd : 'dist' } , function ( err , stdout , stderr ) {
6969 var lines = stdout . split ( '\n' ) ;
7070 var dist_repo = '' ;
7171 this . log ( 'stdout: ' + stdout ) ;
7272 if ( err && stderr . search ( 'DL is deprecated' ) === - 1 ) {
7373 this . log . error ( err ) ;
7474 } else {
75- var repo_url_finder = / o p e n s h i f t [ ] * / ;
75+ var repo_url_finder = new RegExp ( this . deployedName + " [ ]*" ) ;
7676 lines . forEach ( function ( line ) {
7777 if ( line . search ( repo_url_finder ) === 0 && dist_repo === '' ) {
7878 var dist_repo_detailed = line . slice ( line . match ( repo_url_finder ) [ 0 ] . length ) ;
@@ -150,7 +150,7 @@ Generator.prototype.gitRemoteAdd = function gitRemoteAdd() {
150150 var done = this . async ( ) ;
151151 this . log ( chalk . bold ( "Adding remote repo url: " + this . dist_repo_url ) ) ;
152152
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 ) {
154154 if ( err ) {
155155 this . log . error ( err ) ;
156156 } else {
@@ -202,7 +202,7 @@ Generator.prototype.gitForcePush = function gitForcePush() {
202202 var done = this . async ( ) ;
203203 this . log ( chalk . bold ( "Uploading your initial application code.\n This may take " + chalk . cyan ( 'several minutes' ) + " depending on your connection speed..." ) ) ;
204204
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 ) {
206206 if ( err ) {
207207 this . log . error ( err ) ;
208208 } else {
@@ -215,7 +215,7 @@ Generator.prototype.gitForcePush = function gitForcePush() {
215215 this . log ( chalk . green ( '\nYou\'re all set! Your app should now be live at \n\t' + chalk . bold ( host_url ) ) ) ;
216216 this . log ( chalk . yellow ( 'After app modification run\n\t' + chalk . bold ( 'grunt build' ) +
217217 '\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') ) ) ;
219219 this . openshift_host_url = host_url ;
220220 }
221221 done ( ) ;
0 commit comments