facult 2.8.6 → 2.8.8
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/README.md +2 -1
- package/bin/fclt.cjs +19 -3
- package/package.json +1 -1
- package/src/paths.ts +1 -1
package/README.md
CHANGED
|
@@ -703,7 +703,8 @@ Under machine-local Facult state:
|
|
|
703
703
|
- `.../autosync/services/*.json` (autosync service configs)
|
|
704
704
|
- `.../autosync/state/*.json` (autosync runtime state)
|
|
705
705
|
- `.../autosync/logs/*` (autosync service logs)
|
|
706
|
-
- `runtime/<version>/<platform-arch>/...` under the machine-local
|
|
706
|
+
- `cache/runtime/<version>/<platform-arch>/...` under the macOS machine-local state root, or `runtime/<version>/<platform-arch>/...` under `FACULT_CACHE_DIR`/XDG cache roots on other platforms (npm launcher binary cache)
|
|
707
|
+
- if that cache root is unavailable, the npm launcher falls back to a temp-dir runtime cache before using the bundled source fallback
|
|
707
708
|
|
|
708
709
|
### Config reference
|
|
709
710
|
|
package/bin/fclt.cjs
CHANGED
|
@@ -45,7 +45,7 @@ function localCacheRoot(home) {
|
|
|
45
45
|
return path.resolve(override);
|
|
46
46
|
}
|
|
47
47
|
if (process.platform === "darwin") {
|
|
48
|
-
return path.join(home, "
|
|
48
|
+
return path.join(localStateRoot(home), "cache");
|
|
49
49
|
}
|
|
50
50
|
const xdg = String(process.env.XDG_CACHE_HOME || "").trim();
|
|
51
51
|
return xdg
|
|
@@ -67,7 +67,7 @@ async function main() {
|
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
const home = os.homedir();
|
|
70
|
-
const cacheRoot =
|
|
70
|
+
const cacheRoot = await runtimeCacheRoot(home);
|
|
71
71
|
const installDir = path.join(
|
|
72
72
|
cacheRoot,
|
|
73
73
|
version,
|
|
@@ -107,7 +107,7 @@ async function main() {
|
|
|
107
107
|
const tag = `v${version}`;
|
|
108
108
|
const assetName = `${PACKAGE_NAME}-${version}-${resolved.platform}-${resolved.arch}${resolved.ext}`;
|
|
109
109
|
const url = `https://github.com/${REPO_OWNER}/${REPO_NAME}/releases/download/${tag}/${assetName}`;
|
|
110
|
-
const tmpPath = `${binaryPath}.tmp-${Date.now()}`;
|
|
110
|
+
const tmpPath = `${binaryPath}.tmp-${process.pid}-${Date.now()}-${Math.random().toString(16).slice(2)}`;
|
|
111
111
|
|
|
112
112
|
try {
|
|
113
113
|
await fsp.mkdir(installDir, { recursive: true });
|
|
@@ -174,6 +174,22 @@ async function main() {
|
|
|
174
174
|
process.exit(1);
|
|
175
175
|
}
|
|
176
176
|
|
|
177
|
+
async function runtimeCacheRoot(home) {
|
|
178
|
+
const primary = path.join(localCacheRoot(home), "runtime");
|
|
179
|
+
try {
|
|
180
|
+
await fsp.mkdir(primary, { recursive: true });
|
|
181
|
+
return primary;
|
|
182
|
+
} catch {
|
|
183
|
+
const fallback = path.join(os.tmpdir(), "fclt", "runtime-cache");
|
|
184
|
+
try {
|
|
185
|
+
await fsp.mkdir(fallback, { recursive: true });
|
|
186
|
+
return fallback;
|
|
187
|
+
} catch {
|
|
188
|
+
return primary;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
|
|
177
193
|
async function canUseSourceFallback(sourceEntry) {
|
|
178
194
|
if (!(await fileExists(sourceEntry))) {
|
|
179
195
|
return false;
|
package/package.json
CHANGED
package/src/paths.ts
CHANGED
|
@@ -114,7 +114,7 @@ export function facultLocalCacheRoot(home: string = defaultHomeDir()): string {
|
|
|
114
114
|
return resolvePath(override, home);
|
|
115
115
|
}
|
|
116
116
|
if (process.platform === "darwin") {
|
|
117
|
-
return join(home, "
|
|
117
|
+
return join(facultLocalStateRoot(home), "cache");
|
|
118
118
|
}
|
|
119
119
|
const xdg = process.env.XDG_CACHE_HOME?.trim();
|
|
120
120
|
return xdg
|