@@ -39,27 +39,29 @@ const main = async () => {
3939 console . log ( 'standalone: done.' )
4040 console . log ( ( await execa . command ( `ls ${ wd } ` , opts ) ) . stdout )
4141
42- console . log ( 'standalone: publishing to homebrew tap...' )
43- const matches = (
44- await execa . command ( `shasum -a 256 ${ wd } /hygen.macos.v${ v } .tar.gz` , opts )
45- ) . stdout . match ( / ( [ a - f 0 - 9 ] + ) \s + / )
46- if ( matches && matches . length > 1 ) {
47- const sha = matches [ 1 ]
48- await fs . writeFile ( '/tmp/hygen.rb' , brewFormula ( sha , v ) ) // eslint-disable-line @typescript-eslint/no-use-before-define
49- const cmd = [
50- `cd /tmp` ,
51- `git clone git://${ repo } brew-tap` ,
52- `cd brew-tap` ,
53- `mv /tmp/hygen.rb .` ,
54- `git config user.email [email protected] ` , 55- `git config user.name 'Dotan Nahum'` ,
56- `git add .` ,
57- `git commit -m 'hygen: auto-release'` ,
58- `git push https://${ process . env . GITHUB_TOKEN } @${ repo } ` ,
59- ] . join ( ' && ' )
60- await execa . command ( cmd , opts )
42+ if ( process . env . MANUAL_HB_PUBLISH ) {
43+ console . log ( 'standalone: publishing to homebrew tap...' )
44+ const matches = (
45+ await execa . command ( `shasum -a 256 ${ wd } /hygen.macos.v${ v } .tar.gz` , opts )
46+ ) . stdout . match ( / ( [ a - f 0 - 9 ] + ) \s + / )
47+ if ( matches && matches . length > 1 ) {
48+ const sha = matches [ 1 ]
49+ await fs . writeFile ( '/tmp/hygen.rb' , brewFormula ( sha , v ) ) // eslint-disable-line @typescript-eslint/no-use-before-define
50+ const cmd = [
51+ `cd /tmp` ,
52+ `git clone git://${ repo } brew-tap` ,
53+ `cd brew-tap` ,
54+ `mv /tmp/hygen.rb .` ,
55+ `git config user.email [email protected] ` , 56+ `git config user.name 'Dotan Nahum'` ,
57+ `git add .` ,
58+ `git commit -m 'hygen: auto-release'` ,
59+ `git push https://${ process . env . GITHUB_TOKEN } @${ repo } ` ,
60+ ] . join ( ' && ' )
61+ await execa . command ( cmd , opts )
6162
62- console . log ( 'standalone: publish done.' )
63+ console . log ( 'standalone: publish done.' )
64+ }
6365 }
6466}
6567
0 commit comments