uloop-cli 0.62.4 → 0.63.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.
- package/dist/cli.bundle.cjs +58 -3
- package/dist/cli.bundle.cjs.map +2 -2
- package/package.json +9 -9
- package/src/default-tools.json +1 -1
- package/src/version.ts +1 -1
package/dist/cli.bundle.cjs
CHANGED
|
@@ -5783,7 +5783,7 @@ var import_path3 = require("path");
|
|
|
5783
5783
|
|
|
5784
5784
|
// src/default-tools.json
|
|
5785
5785
|
var default_tools_default = {
|
|
5786
|
-
version: "0.
|
|
5786
|
+
version: "0.63.0",
|
|
5787
5787
|
tools: [
|
|
5788
5788
|
{
|
|
5789
5789
|
name: "compile",
|
|
@@ -6227,7 +6227,7 @@ function getCachedServerVersion() {
|
|
|
6227
6227
|
}
|
|
6228
6228
|
|
|
6229
6229
|
// src/version.ts
|
|
6230
|
-
var VERSION = "0.
|
|
6230
|
+
var VERSION = "0.63.0";
|
|
6231
6231
|
|
|
6232
6232
|
// src/spinner.ts
|
|
6233
6233
|
var SPINNER_FRAMES = ["\u280B", "\u2819", "\u2839", "\u2838", "\u283C", "\u2834", "\u2826", "\u2827", "\u2807", "\u280F"];
|
|
@@ -7545,7 +7545,7 @@ var getProjectCliArgs = async (projectPath) => {
|
|
|
7545
7545
|
var execFileAsync = (0, import_node_util.promisify)(import_node_child_process.execFile);
|
|
7546
7546
|
var UNITY_EXECUTABLE_PATTERN_MAC = /Unity\.app\/Contents\/MacOS\/Unity/i;
|
|
7547
7547
|
var UNITY_EXECUTABLE_PATTERN_WINDOWS = /Unity\.exe/i;
|
|
7548
|
-
var PROJECT_PATH_PATTERN = /-(?:projectPath|projectpath)(?:=|\s+)("[^"]+"|'[^']+'
|
|
7548
|
+
var PROJECT_PATH_PATTERN = /-(?:projectPath|projectpath)(?:=|\s+)("[^"]+"|'[^']+'|.+?)(?=\s+-[a-zA-Z]|$)/i;
|
|
7549
7549
|
var PROCESS_LIST_COMMAND_MAC = "ps";
|
|
7550
7550
|
var PROCESS_LIST_ARGS_MAC = ["-axo", "pid=,command=", "-ww"];
|
|
7551
7551
|
var WINDOWS_POWERSHELL = "powershell";
|
|
@@ -7785,12 +7785,53 @@ async function focusUnityProcessWindows(pid) {
|
|
|
7785
7785
|
console.warn(`Failed to bring Unity to front on Windows: ${message}`);
|
|
7786
7786
|
}
|
|
7787
7787
|
}
|
|
7788
|
+
async function isLockfileHeldMac(lockfilePath) {
|
|
7789
|
+
try {
|
|
7790
|
+
const result = await execFileAsync("lsof", [lockfilePath]);
|
|
7791
|
+
const lines = result.stdout.split("\n").filter((line) => line.length > 0);
|
|
7792
|
+
return lines.length > 1;
|
|
7793
|
+
} catch {
|
|
7794
|
+
return false;
|
|
7795
|
+
}
|
|
7796
|
+
}
|
|
7797
|
+
async function isLockfileHeldWindows(lockfilePath) {
|
|
7798
|
+
const escapedPath = lockfilePath.replace(/'/g, "''");
|
|
7799
|
+
const scriptLines = [
|
|
7800
|
+
"try {",
|
|
7801
|
+
` $f = [System.IO.File]::Open('${escapedPath}', [System.IO.FileMode]::Open, [System.IO.FileAccess]::ReadWrite, [System.IO.FileShare]::None)`,
|
|
7802
|
+
" $f.Close()",
|
|
7803
|
+
" Write-Output 'UNLOCKED'",
|
|
7804
|
+
"} catch [System.IO.IOException] {",
|
|
7805
|
+
" Write-Output 'LOCKED'",
|
|
7806
|
+
"} catch {",
|
|
7807
|
+
" Write-Output 'UNLOCKED'",
|
|
7808
|
+
"}"
|
|
7809
|
+
];
|
|
7810
|
+
try {
|
|
7811
|
+
const result = await execFileAsync(WINDOWS_POWERSHELL, ["-NoProfile", "-Command", scriptLines.join("\n")]);
|
|
7812
|
+
return result.stdout.trim() === "LOCKED";
|
|
7813
|
+
} catch {
|
|
7814
|
+
return false;
|
|
7815
|
+
}
|
|
7816
|
+
}
|
|
7817
|
+
async function isLockfileHeld(lockfilePath) {
|
|
7818
|
+
if (process.platform === "darwin") {
|
|
7819
|
+
return await isLockfileHeldMac(lockfilePath);
|
|
7820
|
+
}
|
|
7821
|
+
if (process.platform === "win32") {
|
|
7822
|
+
return await isLockfileHeldWindows(lockfilePath);
|
|
7823
|
+
}
|
|
7824
|
+
return false;
|
|
7825
|
+
}
|
|
7788
7826
|
async function handleStaleLockfile(projectPath) {
|
|
7789
7827
|
const tempDirectoryPath = (0, import_node_path2.join)(projectPath, TEMP_DIRECTORY_NAME);
|
|
7790
7828
|
const lockfilePath = (0, import_node_path2.join)(tempDirectoryPath, UNITY_LOCKFILE_NAME);
|
|
7791
7829
|
if (!(0, import_node_fs2.existsSync)(lockfilePath)) {
|
|
7792
7830
|
return;
|
|
7793
7831
|
}
|
|
7832
|
+
if (await isLockfileHeld(lockfilePath)) {
|
|
7833
|
+
throw new Error(`Unity appears to be running for this project (lockfile is held: ${lockfilePath}). Use -r to restart or -q to quit the running instance.`);
|
|
7834
|
+
}
|
|
7794
7835
|
console.log(`UnityLockfile found without active Unity process: ${lockfilePath}`);
|
|
7795
7836
|
console.log("Assuming previous crash. Cleaning Temp directory and continuing launch.");
|
|
7796
7837
|
try {
|
|
@@ -7809,6 +7850,8 @@ async function handleStaleLockfile(projectPath) {
|
|
|
7809
7850
|
}
|
|
7810
7851
|
console.log();
|
|
7811
7852
|
}
|
|
7853
|
+
var LOCKFILE_POLL_INTERVAL_MS = 100;
|
|
7854
|
+
var LOCKFILE_WAIT_TIMEOUT_MS = 5e3;
|
|
7812
7855
|
var KILL_POLL_INTERVAL_MS = 100;
|
|
7813
7856
|
var KILL_TIMEOUT_MS = 1e4;
|
|
7814
7857
|
var GRACEFUL_QUIT_TIMEOUT_MS = 1e4;
|
|
@@ -7994,6 +8037,17 @@ function findUnityProjectBfs(rootDir, maxDepth) {
|
|
|
7994
8037
|
}
|
|
7995
8038
|
return void 0;
|
|
7996
8039
|
}
|
|
8040
|
+
async function waitForLockfile(projectPath) {
|
|
8041
|
+
const lockfilePath = (0, import_node_path2.join)(projectPath, TEMP_DIRECTORY_NAME, UNITY_LOCKFILE_NAME);
|
|
8042
|
+
const start = Date.now();
|
|
8043
|
+
while (Date.now() - start < LOCKFILE_WAIT_TIMEOUT_MS) {
|
|
8044
|
+
if ((0, import_node_fs2.existsSync)(lockfilePath)) {
|
|
8045
|
+
return;
|
|
8046
|
+
}
|
|
8047
|
+
await new Promise((resolve5) => setTimeout(resolve5, LOCKFILE_POLL_INTERVAL_MS));
|
|
8048
|
+
}
|
|
8049
|
+
console.warn("Unity launched, but UnityLockfile was not detected within 5s.");
|
|
8050
|
+
}
|
|
7997
8051
|
async function launch(opts) {
|
|
7998
8052
|
const { projectPath, platform, unityArgs, unityVersion } = opts;
|
|
7999
8053
|
const unityPath = getUnityPath(unityVersion);
|
|
@@ -8094,6 +8148,7 @@ async function orchestrateLaunch(options) {
|
|
|
8094
8148
|
unityVersion
|
|
8095
8149
|
};
|
|
8096
8150
|
await launch(resolved);
|
|
8151
|
+
await waitForLockfile(resolvedProjectPath);
|
|
8097
8152
|
const now = /* @__PURE__ */ new Date();
|
|
8098
8153
|
try {
|
|
8099
8154
|
await updateLastModifiedIfExists(resolvedProjectPath, now);
|