@jixoai/gh-runner 0.2.1 → 0.2.2
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/main.mjs +11 -2
- package/package.json +1 -1
package/dist/main.mjs
CHANGED
|
@@ -447,14 +447,23 @@ async function stopProcessGroup(pid, graceMs = 8e3) {
|
|
|
447
447
|
// src/config.ts
|
|
448
448
|
const DEFAULT_SEARCH_DIRS = defaultSearchDirs();
|
|
449
449
|
function configDir() {
|
|
450
|
+
if (process.platform === "win32") {
|
|
451
|
+
const appData = process.env.APPDATA ?? join(homedir(), "AppData", "Roaming");
|
|
452
|
+
return join(appData, "gh-runner");
|
|
453
|
+
}
|
|
450
454
|
return join(homedir(), "Library", "Application Support", "gh-runner");
|
|
451
455
|
}
|
|
452
456
|
function configPath() {
|
|
453
457
|
return join(configDir(), "config.json");
|
|
454
458
|
}
|
|
455
|
-
/** 形状校验:损坏的实例项直接丢弃(手编配置/撕裂写的容错),不让 boot 崩掉。
|
|
459
|
+
/** 形状校验:损坏的实例项直接丢弃(手编配置/撕裂写的容错),不让 boot 崩掉。
|
|
460
|
+
* 路径合法性平台无关(POSIX 绝对 / win32 盘符 / UNC 均可)——config 是本机产物,
|
|
461
|
+
* 但 Windows 盘符路径曾被 startsWith("/") 全量误杀并回写空清单(v0.2.2 实证事故)。 */
|
|
462
|
+
function isAbsoluteish(p) {
|
|
463
|
+
return p.startsWith("/") || /^[A-Za-z]:[\\/]/.test(p) || p.startsWith("\\\\");
|
|
464
|
+
}
|
|
456
465
|
function validInstance(item) {
|
|
457
|
-
return typeof item === "object" && item !== null && typeof item.dir === "string" && item.dir
|
|
466
|
+
return typeof item === "object" && item !== null && typeof item.dir === "string" && isAbsoluteish(item.dir) && typeof item.id === "string";
|
|
458
467
|
}
|
|
459
468
|
async function loadConfig() {
|
|
460
469
|
try {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jixoai/gh-runner",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "Menu-bar (tray) manager for multiple GitHub Actions self-hosted runners: discover, register from downloaded/imported packages, start/stop, and live job-result analysis. macOS & Windows.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|