Skip to content

Commit 7b333ee

Browse files
1 parent a8a438f commit 7b333ee

File tree

4 files changed

+24
-27
lines changed

4 files changed

+24
-27
lines changed

dist/index.js

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3300,7 +3300,6 @@ async function getAndroidSdkPath(rootEditorPath, androidTargetSdk) {
33003300
return sdkPath;
33013301
}
33023302
async function execSdkManager(sdkManagerPath, javaPath, args) {
3303-
const acceptBuffer = Buffer.from(Array(10).fill('y').join('\n'), 'utf8');
33043303
let output = '';
33053304
let exitCode = 0;
33063305
logger.startGroup(`\x1b[34m${sdkManagerPath} ${args.join(' ')}\x1b[0m`);
@@ -3311,7 +3310,10 @@ async function execSdkManager(sdkManagerPath, javaPath, args) {
33113310
exitCode = await new Promise((resolve, reject) => {
33123311
const child = (0, child_process_1.spawn)(sdkManagerPath, args, {
33133312
stdio: ['pipe', 'pipe', 'pipe'],
3314-
env: { ...process.env, JAVA_HOME: javaPath }
3313+
env: {
3314+
...process.env,
3315+
JAVA_HOME: process.platform === 'win32' ? `"${javaPath}"` : javaPath
3316+
}
33153317
});
33163318
const sigintHandler = () => child.kill('SIGINT');
33173319
const sigtermHandler = () => child.kill('SIGTERM');
@@ -3326,20 +3328,15 @@ async function execSdkManager(sdkManagerPath, javaPath, args) {
33263328
process.removeListener('SIGINT', sigintHandler);
33273329
process.removeListener('SIGTERM', sigtermHandler);
33283330
}
3329-
child.stdout.on('data', (data) => {
3330-
const chunk = data.toString();
3331-
output += chunk;
3332-
if (output.includes('Accept? (y/N):')) {
3333-
child.stdin?.write(acceptBuffer);
3334-
output = '';
3335-
}
3336-
process.stdout.write(chunk);
3337-
});
3338-
child.stderr.on('data', (data) => {
3331+
function handleDataStream(data) {
33393332
const chunk = data.toString();
33403333
output += chunk;
33413334
process.stderr.write(chunk);
3342-
});
3335+
}
3336+
const acceptBuffer = Buffer.from(Array(10).fill('y').join(os_1.default.EOL), 'utf8');
3337+
child.stdin.write(acceptBuffer);
3338+
child.stdout.on('data', (data) => handleDataStream(data));
3339+
child.stderr.on('data', (data) => handleDataStream(data));
33433340
child.on('error', (error) => {
33443341
removeListeners();
33453342
reject(error);

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

Lines changed: 10 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "unity-setup",
3-
"version": "2.0.3",
3+
"version": "2.0.4",
44
"description": "A GitHub action for setting up the Unity Game Engine for CI/CD workflows.",
55
"author": "RageAgainstThePixel",
66
"license": "MIT",
@@ -27,12 +27,12 @@
2727
"@actions/core": "^1.11.1",
2828
"@actions/exec": "^1.1.1",
2929
"@actions/glob": "^0.5.0",
30-
"@rage-against-the-pixel/unity-cli": "^1.3.1",
30+
"@rage-against-the-pixel/unity-cli": "^1.3.2",
3131
"semver": "^7.7.3",
3232
"yaml": "^2.8.1"
3333
},
3434
"devDependencies": {
35-
"@types/node": "^22.18.10",
35+
"@types/node": "^22.18.11",
3636
"@types/semver": "^7.7.1",
3737
"@vercel/ncc": "^0.34.0",
3838
"shx": "^0.4.0",

0 commit comments

Comments
 (0)