Prepare self-contained open-source release (#1)

* feat: prepare self-contained open-source release

* fix: canonicalize missing managed paths

---------

Co-authored-by: luckyyzh <luckyyzh@users.noreply.github.com>
This commit is contained in:
Zihao Yang
2026-07-31 03:39:54 +08:00
committed by GitHub
co-authored by luckyyzh
parent 7392ab9dd7
commit 5c9c6631f5
34 changed files with 1310 additions and 137 deletions
+6 -2
View File
@@ -1,5 +1,5 @@
import { existsSync, realpathSync } from "fs";
import { isAbsolute, relative, resolve, sep } from "path";
import { basename, dirname, isAbsolute, relative, resolve, sep } from "path";
import {
SettingsManager,
type ResourceDiagnostic,
@@ -64,7 +64,11 @@ export function getManagedRuntimePaths(): ManagedRuntimePaths {
function canonicalPath(path: string): string {
const resolved = resolve(path);
if (!existsSync(resolved)) return resolved;
if (!existsSync(resolved)) {
const parent = dirname(resolved);
if (parent === resolved) return resolved;
return resolve(canonicalPath(parent), basename(resolved));
}
try {
return realpathSync.native(resolved);
} catch {