Skip to content

Commit d2fd1b6

Browse files
reorder
1 parent dfb7261 commit d2fd1b6

2 files changed

Lines changed: 18 additions & 19 deletions

File tree

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,12 @@ With options always using double dashes (`--option`) and arguments passed direct
5454
#### Unity Hub
5555

5656
- `unity-cli hub-version`: Print the Unity Hub version.
57-
57+
- `unity-cli hub-path`: Print the Unity Hub executable path.
5858
- `unity-cli hub-install [options]`: Install or update the Unity Hub
5959
- `--auto-update`: Automatically updates the Unity Hub if it is already installed. Cannot be used with --hub-version.
6060
- `--hub-version`: Specify to install a specific version of Unity Hub. Cannot be used with --auto-update.
6161
- `--verbose`: Enable verbose output.
6262
- `--json`: Output installation information in JSON format.
63-
- `unity-cli hub-path`: Print the Unity Hub executable path.
6463
- `unity-cli hub [options] <args...>`: Run Unity Hub command line arguments (passes args directly to the hub executable).
6564
- `<args...>`: Arguments to pass directly to the Unity Hub executable.
6665
- `--verbose`: Enable verbose output.

src/cli.ts

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,23 @@ program.command('hub-version')
136136
}
137137
});
138138

139+
program.command('hub-path')
140+
.description('Print the path to the Unity Hub executable.')
141+
.option('--json', 'Prints the last line of output as JSON string.')
142+
.action(async (options) => {
143+
const hub = new UnityHub();
144+
145+
Logger.instance.CI_setEnvironmentVariable('UNITY_HUB_PATH', hub.executable);
146+
147+
if (options.json) {
148+
process.stdout.write(`\n${JSON.stringify({ UNITY_HUB_PATH: hub.executable })}\n`);
149+
} else {
150+
process.stdout.write(`${hub.executable}\n`);
151+
}
152+
153+
process.exit(0);
154+
});
155+
139156
program.command('hub-install')
140157
.description('Install the Unity Hub.')
141158
.option('--verbose', 'Enable verbose logging.')
@@ -168,23 +185,6 @@ program.command('hub-install')
168185
process.exit(0);
169186
});
170187

171-
program.command('hub-path')
172-
.description('Print the path to the Unity Hub executable.')
173-
.option('--json', 'Prints the last line of output as JSON string.')
174-
.action(async (options) => {
175-
const hub = new UnityHub();
176-
177-
Logger.instance.CI_setEnvironmentVariable('UNITY_HUB_PATH', hub.executable);
178-
179-
if (options.json) {
180-
process.stdout.write(`\n${JSON.stringify({ UNITY_HUB_PATH: hub.executable })}\n`);
181-
} else {
182-
process.stdout.write(`${hub.executable}\n`);
183-
}
184-
185-
process.exit(0);
186-
});
187-
188188
program.command('hub')
189189
.description('Run commands directly to the Unity Hub. (You need not to pass --headless or -- to this command).')
190190
.allowUnknownOption(true)

0 commit comments

Comments
 (0)