diff --git a/.github/workflows/unity-build.yml b/.github/workflows/unity-build.yml index b329463..c217309 100644 --- a/.github/workflows/unity-build.yml +++ b/.github/workflows/unity-build.yml @@ -37,7 +37,7 @@ jobs: unity-cli hub-install --auto-update unity-cli activate-license --license personal --email "${{ secrets.UNITY_USERNAME }}" --password "${{ secrets.UNITY_PASSWORD }}" setup_output=$(unity-cli setup-unity --unity-version "${{ matrix.unity-version }}" --build-targets "${{ matrix.build-targets }}" --json) - unity_editor_path=$(echo "$setup_output" | tail -n 1 | jq -r '.UNITY_EDITOR') + unity_editor_path=$(echo "$setup_output" | tail -n 1 | jq -r '.UNITY_EDITOR_PATH') echo "$unity_editor_path" create_project_output=$(unity-cli create-project --name "Unity Project" --unity-editor "${unity_editor_path}" --json --verbose) project_path=$(echo "$create_project_output" | tail -n 1 | jq -r '.UNITY_PROJECT_PATH') diff --git a/package.json b/package.json index 115cb7d..252eace 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@rage-against-the-pixel/unity-cli", - "version": "1.0.5", + "version": "1.0.6", "description": "A command line utility for the Unity Game Engine.", "author": "RageAgainstThePixel", "license": "MIT", @@ -13,6 +13,7 @@ }, "homepage": "https://github.com/RageAgainstThePixel/unity-cli#readme", "keywords": [ + "unity-cli", "unity", "cli", "command-line", diff --git a/src/cli.ts b/src/cli.ts index 408d1c3..8d49491 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -217,7 +217,7 @@ program.command('setup-unity') const unityEditor = await unityHub.GetEditor(unityVersion, modules); const output: { [key: string]: string } = { 'UNITY_HUB_PATH': unityHub.executable, - 'UNITY_EDITOR': unityEditor.editorPath + 'UNITY_EDITOR_PATH': unityEditor.editorPath }; if (unityProject) { @@ -238,7 +238,7 @@ program.command('create-project') .option('--name ', 'The name of the new Unity project. If unspecified, the project will be created in the specified path or the current working directory.') .option('--path ', 'The path to create the new Unity project. If unspecified, the current working directory will be used.') .option('--template ', 'The name of the template package to use for creating the unity project. Supports regex patterns.', 'com.unity.template.3d(-cross-platform)?') - .option('--unity-editor ', 'The path to the Unity Editor executable. If unspecified, the UNITY_EDITOR environment variable must be set.') + .option('--unity-editor ', 'The path to the Unity Editor executable. If unspecified, the UNITY_EDITOR_PATH environment variable must be set.') .option('--verbose', 'Enable verbose logging.') .option('--json', 'Prints the last line of output as JSON string.') .action(async (options) => { @@ -248,10 +248,10 @@ program.command('create-project') Logger.instance.debug(JSON.stringify(options)); - const editorPath = options.unityEditor?.toString()?.trim() || process.env.UNITY_EDITOR; + const editorPath = options.unityEditor?.toString()?.trim() || process.env.UNITY_EDITOR_PATH; if (!editorPath || editorPath.length === 0) { - 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.'); + 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.'); } const unityEditor = new UnityEditor(editorPath); @@ -287,7 +287,7 @@ program.command('create-project') program.command('run') .description('Run command line args directly to the Unity Editor.') - .option('--unity-editor ', 'The path to the Unity Editor executable. If unspecified, the UNITY_EDITOR environment variable must be set.') + .option('--unity-editor ', 'The path to the Unity Editor executable. If unspecified, the UNITY_EDITOR_PATH environment variable must be set.') .option('--unity-project ', 'The path to a Unity project. If unspecified, the UNITY_PROJECT_PATH environment variable or the current working directory will be used.') .option('--log-name ', 'The name of the log file.') .allowUnknownOption(true) @@ -300,10 +300,10 @@ program.command('run') Logger.instance.debug(JSON.stringify({ options, args })); - const editorPath = options.unityEditor?.toString()?.trim() || process.env.UNITY_EDITOR; + const editorPath = options.unityEditor?.toString()?.trim() || process.env.UNITY_EDITOR_PATH; if (!editorPath || editorPath.length === 0) { - 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.'); + 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.'); } const unityEditor = new UnityEditor(editorPath);