File tree Expand file tree Collapse file tree 3 files changed +34
-17
lines changed Expand file tree Collapse file tree 3 files changed +34
-17
lines changed Original file line number Diff line number Diff line change @@ -30,5 +30,5 @@ outputs:
30
30
description : ' The total time taken to complete the deployment process.'
31
31
runs :
32
32
using : ' node20'
33
- pre : ' ./pre.sh '
33
+ pre : ' ./pre.js '
34
34
main : ' dist/index.js'
Original file line number Diff line number Diff line change
1
+ import * as child from 'child_process' ;
2
+
3
+ const run = ( command ) => {
4
+ return new Promise ( ( resolve , reject ) => {
5
+ child . exec ( command , ( error , stdout ) => {
6
+ if ( error ) {
7
+ reject ( error ) ;
8
+ return ;
9
+ }
10
+
11
+ resolve ( stdout ) ;
12
+ } ) ;
13
+ } ) ;
14
+ } ;
15
+
16
+ const main = async ( ) => {
17
+ try {
18
+ console . log ( "Starting npm install and build process..." ) ;
19
+
20
+ // Run npm install
21
+ await run ( "npm install" ) ;
22
+
23
+ // Run npm build
24
+ await run ( "npm run build" ) ;
25
+
26
+ console . log ( "npm install and build completed successfully!" ) ;
27
+ } catch ( error ) {
28
+ console . error ( "Process failed:" , error ) ;
29
+ process . exit ( 1 ) ; // Exit with an error code
30
+ }
31
+ } ;
32
+
33
+ export default main ;
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments