@@ -112,16 +112,19 @@ class HerokuApp {
112
112
context . nxJsonConfiguration ?. workspaceLayout ?. appsDir || 'apps' ;
113
113
}
114
114
115
- private async addAndCommit (
115
+ private async addAndCommitFile (
116
116
projectName : string ,
117
- pattern : string
117
+ fileName : string
118
118
) : Promise < void > {
119
119
try {
120
- //? allow custom commit message
120
+ //? allow custom commit message with format from 'util'
121
+ // const COMMIT_MESSAGE_TEMPLATE = '%s(%s): %s';
122
+ // format(COMMIT_MESSAGE_TEMPLATE, conf.type, conf.scope, conf.message);
123
+ const path = `${ this . appsDir } /${ projectName } /${ fileName } ` ;
121
124
await exec (
122
- `git add ${ pattern } && git commit -m "ci(${ projectName } ): add ${ pattern } " -n --no-gpg-sign`
125
+ `git add ${ path } && git commit -m "ci(${ projectName } ): add ${ fileName } " -n --no-gpg-sign`
123
126
) ;
124
- this . logger . info ( `Wrote ${ pattern } with custom configuration.` ) ;
127
+ this . logger . info ( `Wrote ${ path } with custom configuration.` ) ;
125
128
} catch ( error ) {
126
129
const ex = error as ExecException ;
127
130
// there is (probably) nothing to commit
@@ -136,7 +139,7 @@ class HerokuApp {
136
139
if ( procfile ) {
137
140
const procfilePath = `${ this . appsDir } /${ projectName } /${ PROCFILE } ` ;
138
141
await writeFile ( join ( process . cwd ( ) , procfilePath ) , procfile ) ;
139
- await this . addAndCommit ( projectName , PROCFILE ) ;
142
+ await this . addAndCommitFile ( projectName , PROCFILE ) ;
140
143
}
141
144
}
142
145
@@ -157,7 +160,7 @@ class HerokuApp {
157
160
if ( destBuildPackFile === srcBuildPackFile ) return ;
158
161
159
162
await writeFile ( destPath , srcBuildPackFile ) ;
160
- await this . addAndCommit ( projectName , buildPackFile ) ;
163
+ await this . addAndCommitFile ( projectName , buildPackFile ) ;
161
164
}
162
165
}
163
166
@@ -325,10 +328,14 @@ class HerokuApp {
325
328
args . push ( '--force' ) ;
326
329
}
327
330
328
- const push = spawn ( 'git' , args , { signal } ) ;
329
- //? if data contains `Everything up-to-date`, should we still restart the app
331
+ console . warn ( {
332
+ cwd : process . cwd ( ) ,
333
+ cwd2 : this . context . cwd ,
334
+ } ) ;
335
+ const push = spawn ( 'git' , args , { signal, cwd : this . context . cwd } ) ;
330
336
push . stdout
331
337
. setEncoding ( 'utf-8' )
338
+ //? if data contains `Everything up-to-date`, should we still restart the app ?
332
339
. on ( 'data' , ( data ) => this . logger . info ( data ?. trim ( ) ) ) ;
333
340
334
341
push . stderr
0 commit comments