uloop-cli 0.62.3 → 0.62.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "uloop-cli",
3
- "version": "0.62.3",
3
+ "version": "0.62.4",
4
4
  "//version": "x-release-please-version",
5
5
  "description": "CLI tool for Unity Editor communication via uLoopMCP",
6
6
  "main": "dist/cli.bundle.cjs",
package/src/cli.ts CHANGED
@@ -39,12 +39,16 @@ interface CliOptions extends GlobalOptions {
39
39
  }
40
40
 
41
41
  const LAUNCH_COMMAND = 'launch' as const;
42
+ const UPDATE_COMMAND = 'update' as const;
43
+
44
+ // commander.js built-in flags that exit immediately without needing Unity
45
+ const NO_SYNC_FLAGS = ['-v', '--version', '-h', '--help'] as const;
42
46
 
43
47
  const BUILTIN_COMMANDS = [
44
48
  'list',
45
49
  'sync',
46
50
  'completion',
47
- 'update',
51
+ UPDATE_COMMAND,
48
52
  'fix',
49
53
  'skills',
50
54
  LAUNCH_COMMAND,
@@ -745,6 +749,13 @@ function commandExists(cmdName: string): boolean {
745
749
  return tools.tools.some((t) => t.name === cmdName);
746
750
  }
747
751
 
752
+ function shouldSkipAutoSync(cmdName: string | undefined, args: string[]): boolean {
753
+ if (cmdName === LAUNCH_COMMAND || cmdName === UPDATE_COMMAND) {
754
+ return true;
755
+ }
756
+ return args.some((arg) => (NO_SYNC_FLAGS as readonly string[]).includes(arg));
757
+ }
758
+
748
759
  /**
749
760
  * Main entry point with auto-sync for unknown commands.
750
761
  */
@@ -756,8 +767,7 @@ async function main(): Promise<void> {
756
767
  const args = process.argv.slice(2);
757
768
  const cmdName = args.find((arg) => !arg.startsWith('-'));
758
769
 
759
- // launch starts Unity, so it cannot connect to Unity for sync
760
- if (cmdName !== LAUNCH_COMMAND) {
770
+ if (!shouldSkipAutoSync(cmdName, args)) {
761
771
  // Check if cache version is outdated and auto-sync if needed
762
772
  const cachedVersion = loadToolsCache().version;
763
773
  if (hasCacheFile() && cachedVersion !== VERSION) {
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.62.3",
2
+ "version": "0.62.4",
3
3
  "tools": [
4
4
  {
5
5
  "name": "compile",
package/src/version.ts CHANGED
@@ -4,4 +4,4 @@
4
4
  * This file exists to avoid bundling the entire package.json into the CLI bundle.
5
5
  * This version is automatically updated by release-please.
6
6
  */
7
- export const VERSION = '0.62.3'; // x-release-please-version
7
+ export const VERSION = '0.62.4'; // x-release-please-version