File tree Expand file tree Collapse file tree 1 file changed +14
-6
lines changed Expand file tree Collapse file tree 1 file changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -80,12 +80,20 @@ function getClientEnvironment() {
8080 ) ;
8181
8282 raw . RATEL_BUILT_AT = new Date ( ) . toISOString ( ) ;
83- raw . RATEL_COMMIT_ID = child_process . execSync ( 'git rev-parse --short HEAD' )
84- . toString ( )
85- . trim ( ) ;
86- raw . RATEL_COMMIT_INFO = child_process . execSync ( `git show --pretty=format:"%h %ad %d" ${ JSON . stringify ( raw . RATEL_COMMIT_ID ) } | head -n1` )
87- . toString ( )
88- . trim ( ) ;
83+ try {
84+ raw . RATEL_COMMIT_ID = child_process . execSync ( 'git rev-parse --short HEAD' )
85+ . toString ( )
86+ . trim ( ) ;
87+ } catch ( err ) {
88+ raw . RATEL_COMMIT_ID = '<not git>'
89+ }
90+ try {
91+ raw . RATEL_COMMIT_INFO = child_process . execSync ( `git show --pretty=format:"%h %ad %d" ${ JSON . stringify ( raw . RATEL_COMMIT_ID ) } | head -n1` )
92+ . toString ( )
93+ . trim ( ) ;
94+ } catch ( err ) {
95+ raw . RATEL_COMMIT_INFO = '<UNKNOWN COMMIT>'
96+ }
8997 // Stringify all values so we can feed into Webpack DefinePlugin
9098 const stringified = {
9199 "process.env" : Object . keys ( raw ) . reduce ( ( env , key ) => {
You can’t perform that action at this time.
0 commit comments