Skip to content

Commit 5827da9

Browse files
committed
check
1 parent 8947b3b commit 5827da9

File tree

2 files changed

+24
-20
lines changed

2 files changed

+24
-20
lines changed

dist/index.js

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28355,6 +28355,15 @@ const io = __nccwpck_require__(4994);
2835528355

2835628356
const platform = process.platform;
2835728357

28358+
async function execOVM(args, options = {}) {
28359+
if (platform === 'darwin') {
28360+
const joinedArgs = args.map(a => `'${a}'`).join(' ');
28361+
await exec.exec('bash', ['-c', `ovm ${joinedArgs}`], options);
28362+
} else {
28363+
await exec.exec('ovm', args, options);
28364+
}
28365+
}
28366+
2835828367
async function run() {
2835928368
try {
2836028369

@@ -28404,15 +28413,8 @@ async function run() {
2840428413
fs.unlinkSync(tmpFile.name);
2840528414
}
2840628415

28407-
// await exec.exec('ovm install ' + osVersion);
28408-
await exec.exec('bash', ['-c', `ovm install ${osVersion}`], {
28409-
// await exec.exec('ovm install ' + osVersion, [], {
28410-
listeners: {
28411-
stdout: (data) => console.log(data.toString()),
28412-
stderr: (data) => console.error('ERR:', data.toString())
28413-
}
28414-
});
28415-
await exec.exec('ovm use ' + osVersion);
28416+
await execOVM(['install', osVersion]);
28417+
await execOVM(['use', osVersion]);
2841628418

2841728419
let output = '';
2841828420
const options = {};
@@ -28423,7 +28425,7 @@ async function run() {
2842328425
}
2842428426
}
2842528427
};
28426-
await exec.exec('ovm', ['which', 'current'], options);
28428+
await execOVM(['which', 'current'], options);
2842728429
let pathOscript = path.dirname(output);
2842828430

2842928431
core.addPath(pathOscript);

src/index.js

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,15 @@ const io = require('@actions/io');
77

88
const platform = process.platform;
99

10+
async function execOVM(args, options = {}) {
11+
if (platform === 'darwin') {
12+
const joinedArgs = args.map(a => `'${a}'`).join(' ');
13+
await exec.exec('bash', ['-c', `ovm ${joinedArgs}`], options);
14+
} else {
15+
await exec.exec('ovm', args, options);
16+
}
17+
}
18+
1019
async function run() {
1120
try {
1221

@@ -56,15 +65,8 @@ async function run() {
5665
fs.unlinkSync(tmpFile.name);
5766
}
5867

59-
// await exec.exec('ovm install ' + osVersion);
60-
await exec.exec('bash', ['-c', `ovm install ${osVersion}`], {
61-
// await exec.exec('ovm install ' + osVersion, [], {
62-
listeners: {
63-
stdout: (data) => console.log(data.toString()),
64-
stderr: (data) => console.error('ERR:', data.toString())
65-
}
66-
});
67-
await exec.exec('ovm use ' + osVersion);
68+
await execOVM(['install', osVersion]);
69+
await execOVM(['use', osVersion]);
6870

6971
let output = '';
7072
const options = {};
@@ -75,7 +77,7 @@ async function run() {
7577
}
7678
}
7779
};
78-
await exec.exec('ovm', ['which', 'current'], options);
80+
await execOVM(['which', 'current'], options);
7981
let pathOscript = path.dirname(output);
8082

8183
core.addPath(pathOscript);

0 commit comments

Comments
 (0)