uloop-cli 1.6.4 → 1.7.0

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.
@@ -5605,8 +5605,12 @@ function isUnityProject(dirPath) {
5605
5605
  const hasProjectSettings = (0, import_fs.existsSync)((0, import_path.join)(dirPath, "ProjectSettings"));
5606
5606
  return hasAssets && hasProjectSettings;
5607
5607
  }
5608
+ function getUnitySettingsCandidatePaths(dirPath) {
5609
+ const settingsPath = (0, import_path.join)(dirPath, "UserSettings/UnityMcpSettings.json");
5610
+ return [settingsPath, `${settingsPath}.tmp`, `${settingsPath}.bak`];
5611
+ }
5608
5612
  function hasUloopInstalled(dirPath) {
5609
- return (0, import_fs.existsSync)((0, import_path.join)(dirPath, "UserSettings/UnityMcpSettings.json"));
5613
+ return getUnitySettingsCandidatePaths(dirPath).some((path) => (0, import_fs.existsSync)(path));
5610
5614
  }
5611
5615
  function isUnityProjectWithUloop(dirPath) {
5612
5616
  return isUnityProject(dirPath) && hasUloopInstalled(dirPath);
@@ -5813,34 +5817,32 @@ Run 'uloop launch -r' to restart Unity.`
5813
5817
  );
5814
5818
  }
5815
5819
  async function readPortFromSettingsOrThrow(projectRoot) {
5816
- const settingsPath = (0, import_path2.join)(projectRoot, "UserSettings/UnityMcpSettings.json");
5817
- if (!(0, import_fs2.existsSync)(settingsPath)) {
5818
- throw createSettingsReadError(projectRoot);
5819
- }
5820
- let content;
5821
- try {
5822
- content = await (0, import_promises.readFile)(settingsPath, "utf-8");
5823
- } catch {
5824
- throw createSettingsReadError(projectRoot);
5825
- }
5826
- let parsed;
5827
- try {
5828
- parsed = JSON.parse(content);
5829
- } catch {
5830
- throw createSettingsReadError(projectRoot);
5831
- }
5832
- if (typeof parsed !== "object" || parsed === null) {
5833
- throw createSettingsReadError(projectRoot);
5834
- }
5835
- const settings = parsed;
5836
- if (settings.isServerRunning === false) {
5837
- throw new UnityNotRunningError(projectRoot);
5838
- }
5839
- const port = resolvePortFromUnitySettings(settings);
5840
- if (port === null) {
5841
- throw createSettingsReadError(projectRoot);
5820
+ for (const settingsPath of getUnitySettingsCandidatePaths(projectRoot)) {
5821
+ let content;
5822
+ try {
5823
+ content = await (0, import_promises.readFile)(settingsPath, "utf-8");
5824
+ } catch {
5825
+ continue;
5826
+ }
5827
+ let parsed;
5828
+ try {
5829
+ parsed = JSON.parse(content);
5830
+ } catch {
5831
+ continue;
5832
+ }
5833
+ if (typeof parsed !== "object" || parsed === null) {
5834
+ continue;
5835
+ }
5836
+ const settings = parsed;
5837
+ if (settings.isServerRunning === false) {
5838
+ throw new UnityNotRunningError(projectRoot);
5839
+ }
5840
+ const port = resolvePortFromUnitySettings(settings);
5841
+ if (port !== null) {
5842
+ return port;
5843
+ }
5842
5844
  }
5843
- return port;
5845
+ throw createSettingsReadError(projectRoot);
5844
5846
  }
5845
5847
 
5846
5848
  // src/project-validator.ts
@@ -5893,7 +5895,7 @@ var import_path4 = require("path");
5893
5895
 
5894
5896
  // src/default-tools.json
5895
5897
  var default_tools_default = {
5896
- version: "1.6.4",
5898
+ version: "1.7.0",
5897
5899
  tools: [
5898
5900
  {
5899
5901
  name: "compile",
@@ -6526,7 +6528,7 @@ function getCachedServerVersion() {
6526
6528
  }
6527
6529
 
6528
6530
  // src/version.ts
6529
- var VERSION = "1.6.4";
6531
+ var VERSION = "1.7.0";
6530
6532
 
6531
6533
  // src/spinner.ts
6532
6534
  var SPINNER_FRAMES = ["\u280B", "\u2819", "\u2839", "\u2838", "\u283C", "\u2834", "\u2826", "\u2827", "\u2807", "\u280F"];