Fix extension repair and add Opus 4.7 overlay
This commit is contained in:
@@ -110,7 +110,7 @@ This usually means the release exists, but not all platform bundles were uploade
|
||||
Workarounds:
|
||||
- try again after the release finishes publishing
|
||||
- pass the latest published version explicitly, e.g.:
|
||||
& ([scriptblock]::Create((irm https://feynman.is/install.ps1))) -Version 0.2.20
|
||||
& ([scriptblock]::Create((irm https://feynman.is/install.ps1))) -Version 0.2.21
|
||||
"@
|
||||
}
|
||||
|
||||
|
||||
@@ -261,7 +261,7 @@ This usually means the release exists, but not all platform bundles were uploade
|
||||
Workarounds:
|
||||
- try again after the release finishes publishing
|
||||
- pass the latest published version explicitly, e.g.:
|
||||
curl -fsSL https://feynman.is/install | bash -s -- 0.2.20
|
||||
curl -fsSL https://feynman.is/install | bash -s -- 0.2.21
|
||||
EOF
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -260,6 +260,23 @@ function ensureParentDir(path) {
|
||||
mkdirSync(dirname(path), { recursive: true });
|
||||
}
|
||||
|
||||
function packageDependencyExists(packagePath, globalNodeModulesRoot, dependency) {
|
||||
return existsSync(resolve(packagePath, "node_modules", dependency)) ||
|
||||
existsSync(resolve(globalNodeModulesRoot, dependency));
|
||||
}
|
||||
|
||||
function installedPackageLooksUsable(packagePath, globalNodeModulesRoot) {
|
||||
if (!existsSync(resolve(packagePath, "package.json"))) return false;
|
||||
try {
|
||||
const pkg = JSON.parse(readFileSync(resolve(packagePath, "package.json"), "utf8"));
|
||||
return Object.keys(pkg.dependencies ?? {}).every((dependency) =>
|
||||
packageDependencyExists(packagePath, globalNodeModulesRoot, dependency)
|
||||
);
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function linkPointsTo(linkPath, targetPath) {
|
||||
try {
|
||||
if (!lstatSync(linkPath).isSymbolicLink()) return false;
|
||||
@@ -281,6 +298,8 @@ function ensureBundledPackageLinks(packageSpecs) {
|
||||
try {
|
||||
if (lstatSync(targetPath).isSymbolicLink()) {
|
||||
rmSync(targetPath, { force: true });
|
||||
} else if (!installedPackageLooksUsable(targetPath, globalNodeModulesRoot)) {
|
||||
rmSync(targetPath, { recursive: true, force: true });
|
||||
}
|
||||
} catch {}
|
||||
if (existsSync(targetPath)) continue;
|
||||
|
||||
Reference in New Issue
Block a user