Skip to content

Commit b8dd158

Browse files
create-unity-project@v2.0.1 (#5)
- update unity-cli@v1.5.0
1 parent ea6dbe1 commit b8dd158

File tree

5 files changed

+36
-23
lines changed

5 files changed

+36
-23
lines changed

dist/index.js

Lines changed: 27 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4362,19 +4362,38 @@ class UnityEditor {
43624362
if (!command.args || command.args.length === 0) {
43634363
throw Error('No command arguments provided for Unity execution');
43644364
}
4365-
if (!command.args.includes(`-automated`)) {
4366-
command.args.push(`-automated`);
4367-
}
4368-
if (!command.args.includes(`-batchmode`)) {
4369-
command.args.push(`-batchmode`);
4370-
}
43714365
if (this.autoAddNoGraphics &&
43724366
!command.args.includes(`-nographics`) &&
43734367
!command.args.includes(`-force-graphics`)) {
4374-
command.args.push(`-nographics`);
4368+
command.args.unshift(`-nographics`);
4369+
}
4370+
if (!command.args.includes(`-batchmode`)) {
4371+
command.args.unshift(`-batchmode`);
4372+
}
4373+
if (!command.args.includes(`-automated`)) {
4374+
command.args.unshift(`-automated`);
43754375
}
43764376
if (!command.args.includes('-logFile')) {
4377-
command.args.push('-logFile', this.GenerateLogFilePath(command.projectPath));
4377+
command.args.unshift('-logFile', this.GenerateLogFilePath(command.projectPath));
4378+
}
4379+
else {
4380+
const existingLogPath = (0, utilities_1.GetArgumentValueAsString)('-logFile', command.args);
4381+
command.args.splice(command.args.indexOf(existingLogPath) - 1, 2);
4382+
command.args.unshift('-logFile', existingLogPath);
4383+
}
4384+
if (command.projectPath) {
4385+
if (!command.args.includes('-projectPath')) {
4386+
command.args.unshift('-projectPath', command.projectPath);
4387+
}
4388+
else {
4389+
const existingPath = (0, utilities_1.GetArgumentValueAsString)('-projectPath', command.args);
4390+
if (existingPath !== command.projectPath) {
4391+
throw Error(`Conflicting project paths provided. Argument: "${existingPath}", Command: "${command.projectPath}"`);
4392+
}
4393+
// Ensure -projectPath is the first argument
4394+
command.args.splice(command.args.indexOf(existingPath) - 1, 2);
4395+
command.args.unshift('-projectPath', command.projectPath);
4396+
}
43784397
}
43794398
const logPath = (0, utilities_1.GetArgumentValueAsString)('-logFile', command.args);
43804399
logTail = (0, utilities_1.TailLogFile)(logPath);
@@ -61423,10 +61442,7 @@ async function main() {
6142361442
const logPath = unityEditor.GenerateLogFilePath(projectPath, 'create-unity-project');
6142461443
const args = [
6142561444
`-logFile`, logPath,
61426-
'-automated',
6142761445
'-quit',
61428-
'-nographics',
61429-
'-batchmode',
6143061446
'-createProject', projectPath,
6143161447
];
6143261448
if (templatePath) {

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: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "create-unity-project",
3-
"version": "2.0.0",
3+
"version": "2.0.1",
44
"description": "A GitHub Action to create a new Unity Project using a predefined template package.",
55
"author": "RageAgainstThePixel",
66
"repository": {
@@ -20,7 +20,7 @@
2020
"main": "dist/index.js",
2121
"dependencies": {
2222
"@actions/core": "^1.11.1",
23-
"@rage-against-the-pixel/unity-cli": "^1.4.3"
23+
"@rage-against-the-pixel/unity-cli": "^1.5.0"
2424
},
2525
"devDependencies": {
2626
"@types/node": "^22.18.12",

src/index.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,7 @@ async function main() {
3636

3737
const args: string[] = [
3838
`-logFile`, logPath,
39-
'-automated',
4039
'-quit',
41-
'-nographics',
42-
'-batchmode',
4340
'-createProject', projectPath,
4441
];
4542

0 commit comments

Comments
 (0)