File tree Expand file tree Collapse file tree 2 files changed +32
-22
lines changed Expand file tree Collapse file tree 2 files changed +32
-22
lines changed Original file line number Diff line number Diff line change @@ -15089,19 +15089,24 @@ var main = async () => {
15089
15089
console.log("All set!");
15090
15090
};
15091
15091
main();
15092
- function execWithOutput(command, options ) {
15092
+ function execWithOutput(command, args ) {
15093
15093
return new Promise(function(resolve, reject) {
15094
- (0, import_exec.exec)(command, options, {
15095
- listeners: {
15096
- stdout: function(res) {
15097
- resolve(res.toString());
15098
- },
15099
- stderr: function(res) {
15100
- core.info(res.toString());
15101
- reject(res.toString());
15094
+ try {
15095
+ (0, import_exec.exec)(command, args, {
15096
+ listeners: {
15097
+ stdout: function(res) {
15098
+ core.info(res.toString());
15099
+ resolve(res.toString());
15100
+ },
15101
+ stderr: function(res) {
15102
+ core.info(res.toString());
15103
+ reject(res.toString());
15104
+ }
15102
15105
}
15103
- }
15104
- });
15106
+ });
15107
+ } catch (e) {
15108
+ reject(e);
15109
+ }
15105
15110
});
15106
15111
}
15107
15112
/*
Original file line number Diff line number Diff line change @@ -45,19 +45,24 @@ const main = async () => {
45
45
46
46
main ( )
47
47
48
- function execWithOutput ( command , options ) {
48
+ function execWithOutput ( command , args ) {
49
49
return new Promise ( function ( resolve , reject ) {
50
- exec ( command , options , {
51
- listeners : {
52
- stdout : function ( res ) {
53
- resolve ( res . toString ( ) )
54
- } ,
55
- stderr : function ( res ) {
56
- core . info ( res . toString ( ) )
57
- reject ( res . toString ( ) )
50
+ try {
51
+ exec ( command , args , {
52
+ listeners : {
53
+ stdout : function ( res ) {
54
+ core . info ( res . toString ( ) )
55
+ resolve ( res . toString ( ) )
56
+ } ,
57
+ stderr : function ( res ) {
58
+ core . info ( res . toString ( ) )
59
+ reject ( res . toString ( ) )
60
+ }
58
61
}
59
- }
60
- } )
62
+ } )
63
+ } catch ( e ) {
64
+ reject ( e )
65
+ }
61
66
} )
62
67
}
63
68
You can’t perform that action at this time.
0 commit comments