Skip to content

Commit d92ea01

Browse files
authored
Исправление определения пути к OneScript в режиме debug на unix (#26)
1 parent 52017de commit d92ea01

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

dist/index.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28414,17 +28414,18 @@ async function run() {
2841428414
await execCommand('ovm', ['install', osVersion]);
2841528415
await execCommand('ovm', ['use', osVersion]);
2841628416

28417-
let output = '';
28417+
let pathOscript = '';
2841828418
const options = {};
2841928419
options.listeners = {
2842028420
stdout: (data) => {
28421-
if (data.toString().includes('ovm')) {
28422-
output += data.toString();
28421+
let output = data.toString().trim();
28422+
let fileName = path.parse(output).name;
28423+
if (fileName == 'oscript' && fs.existsSync(output)) {
28424+
pathOscript = path.dirname(output);
2842328425
}
2842428426
}
2842528427
};
2842628428
await execCommand('ovm', ['which', 'current'], options);
28427-
let pathOscript = path.dirname(output);
2842828429

2842928430
core.addPath(pathOscript);
2843028431

src/index.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,17 +66,18 @@ async function run() {
6666
await execCommand('ovm', ['install', osVersion]);
6767
await execCommand('ovm', ['use', osVersion]);
6868

69-
let output = '';
69+
let pathOscript = '';
7070
const options = {};
7171
options.listeners = {
7272
stdout: (data) => {
73-
if (data.toString().includes('ovm')) {
74-
output += data.toString();
73+
let output = data.toString().trim();
74+
let fileName = path.parse(output).name;
75+
if (fileName == 'oscript' && fs.existsSync(output)) {
76+
pathOscript = path.dirname(output);
7577
}
7678
}
7779
};
7880
await execCommand('ovm', ['which', 'current'], options);
79-
let pathOscript = path.dirname(output);
8081

8182
core.addPath(pathOscript);
8283

0 commit comments

Comments
 (0)