Skip to content

Commit e062f22

Browse files
unity-cli@v1.0.6 (#7)
- fix env.UNITY_EDITOR_PATH
1 parent bd4e782 commit e062f22

3 files changed

Lines changed: 10 additions & 9 deletions

File tree

.github/workflows/unity-build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
unity-cli hub-install --auto-update
3838
unity-cli activate-license --license personal --email "${{ secrets.UNITY_USERNAME }}" --password "${{ secrets.UNITY_PASSWORD }}"
3939
setup_output=$(unity-cli setup-unity --unity-version "${{ matrix.unity-version }}" --build-targets "${{ matrix.build-targets }}" --json)
40-
unity_editor_path=$(echo "$setup_output" | tail -n 1 | jq -r '.UNITY_EDITOR')
40+
unity_editor_path=$(echo "$setup_output" | tail -n 1 | jq -r '.UNITY_EDITOR_PATH')
4141
echo "$unity_editor_path"
4242
create_project_output=$(unity-cli create-project --name "Unity Project" --unity-editor "${unity_editor_path}" --json --verbose)
4343
project_path=$(echo "$create_project_output" | tail -n 1 | jq -r '.UNITY_PROJECT_PATH')

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@rage-against-the-pixel/unity-cli",
3-
"version": "1.0.5",
3+
"version": "1.0.6",
44
"description": "A command line utility for the Unity Game Engine.",
55
"author": "RageAgainstThePixel",
66
"license": "MIT",
@@ -13,6 +13,7 @@
1313
},
1414
"homepage": "https://github.com/RageAgainstThePixel/unity-cli#readme",
1515
"keywords": [
16+
"unity-cli",
1617
"unity",
1718
"cli",
1819
"command-line",

src/cli.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ program.command('setup-unity')
217217
const unityEditor = await unityHub.GetEditor(unityVersion, modules);
218218
const output: { [key: string]: string } = {
219219
'UNITY_HUB_PATH': unityHub.executable,
220-
'UNITY_EDITOR': unityEditor.editorPath
220+
'UNITY_EDITOR_PATH': unityEditor.editorPath
221221
};
222222

223223
if (unityProject) {
@@ -238,7 +238,7 @@ program.command('create-project')
238238
.option('--name <projectName>', 'The name of the new Unity project. If unspecified, the project will be created in the specified path or the current working directory.')
239239
.option('--path <projectPath>', 'The path to create the new Unity project. If unspecified, the current working directory will be used.')
240240
.option('--template <projectTemplate>', 'The name of the template package to use for creating the unity project. Supports regex patterns.', 'com.unity.template.3d(-cross-platform)?')
241-
.option('--unity-editor <unityEditorPath>', 'The path to the Unity Editor executable. If unspecified, the UNITY_EDITOR environment variable must be set.')
241+
.option('--unity-editor <unityEditorPath>', 'The path to the Unity Editor executable. If unspecified, the UNITY_EDITOR_PATH environment variable must be set.')
242242
.option('--verbose', 'Enable verbose logging.')
243243
.option('--json', 'Prints the last line of output as JSON string.')
244244
.action(async (options) => {
@@ -248,10 +248,10 @@ program.command('create-project')
248248

249249
Logger.instance.debug(JSON.stringify(options));
250250

251-
const editorPath = options.unityEditor?.toString()?.trim() || process.env.UNITY_EDITOR;
251+
const editorPath = options.unityEditor?.toString()?.trim() || process.env.UNITY_EDITOR_PATH;
252252

253253
if (!editorPath || editorPath.length === 0) {
254-
throw new Error('The Unity Editor path was not specified. Use -e or --unity-editor to specify it, or set the UNITY_EDITOR environment variable.');
254+
throw new Error('The Unity Editor path was not specified. Use -e or --unity-editor to specify it, or set the UNITY_EDITOR_PATH environment variable.');
255255
}
256256

257257
const unityEditor = new UnityEditor(editorPath);
@@ -287,7 +287,7 @@ program.command('create-project')
287287

288288
program.command('run')
289289
.description('Run command line args directly to the Unity Editor.')
290-
.option('--unity-editor <unityEditorPath>', 'The path to the Unity Editor executable. If unspecified, the UNITY_EDITOR environment variable must be set.')
290+
.option('--unity-editor <unityEditorPath>', 'The path to the Unity Editor executable. If unspecified, the UNITY_EDITOR_PATH environment variable must be set.')
291291
.option('--unity-project <unityProjectPath>', 'The path to a Unity project. If unspecified, the UNITY_PROJECT_PATH environment variable or the current working directory will be used.')
292292
.option('--log-name <logName>', 'The name of the log file.')
293293
.allowUnknownOption(true)
@@ -300,10 +300,10 @@ program.command('run')
300300

301301
Logger.instance.debug(JSON.stringify({ options, args }));
302302

303-
const editorPath = options.unityEditor?.toString()?.trim() || process.env.UNITY_EDITOR;
303+
const editorPath = options.unityEditor?.toString()?.trim() || process.env.UNITY_EDITOR_PATH;
304304

305305
if (!editorPath || editorPath.length === 0) {
306-
throw new Error('The Unity Editor path was not specified. Use -e or --unity-editor to specify it, or set the UNITY_EDITOR environment variable.');
306+
throw new Error('The Unity Editor path was not specified. Use -e or --unity-editor to specify it, or set the UNITY_EDITOR_PATH environment variable.');
307307
}
308308

309309
const unityEditor = new UnityEditor(editorPath);

0 commit comments

Comments
 (0)