File tree Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " api-explorer" ,
3
- "version" : " 1.1.0 " ,
3
+ "version" : " 1.1.1 " ,
4
4
"private" : true ,
5
5
"scripts" : {
6
6
"dev" : " vite & ts-node server/app.ts" ,
Original file line number Diff line number Diff line change @@ -121,8 +121,20 @@ console.log(
121
121
)
122
122
123
123
// Get commit ID
124
- export const commitId = execSync ( 'git rev-parse HEAD' ) . toString ( ) . trim ( ) ;
125
- console . log ( 'Current Commit ID:' , commitId ) ;
124
+ export let commitId = '' ;
125
+
126
+ try {
127
+ // Try to get the commit ID
128
+ commitId = execSync ( 'git rev-parse HEAD' , { encoding : 'utf-8' } ) . trim ( ) ;
129
+ console . log ( 'Current Commit ID:' , commitId ) ;
130
+ } catch ( error ) {
131
+ // Log the error but do not terminate the process
132
+ console . error ( 'Warning: Failed to retrieve the commit ID. Proceeding without it.' ) ;
133
+ console . error ( 'Error details:' , error . message ) ;
134
+ commitId = 'unknown' ; // Assign a fallback value
135
+ }
136
+ // Continue execution with or without a valid commit ID
137
+ console . log ( 'Execution continues with commitId:' , commitId ) ;
126
138
127
139
// Error Handling to Shut Down the App
128
140
server . on ( 'error' , ( err ) => {
You can’t perform that action at this time.
0 commit comments