mirror of
https://github.com/badlogic/pi-mono.git
synced 2026-11-05 23:37:25 +00:00
fix(coding-agent): accept managed install markers with a UTF-8 BOM
Windows PowerShell 5.1 adds a BOM when it rewrites managed-install.json, which made pi update fail with "Managed install marker is missing or invalid".
This commit is contained in:
parent
530015d93a
commit
ea25697e91
3 changed files with 21 additions and 1 deletions
|
|
@ -37,6 +37,7 @@ import { hasTrustRequiringProjectResources, ProjectTrustStore } from "./core/tru
|
|||
import { spawnProcess, spawnProcessSync, waitForChildProcess } from "./utils/child-process.ts";
|
||||
import { canonicalizePath, getCwdRelativePath } from "./utils/paths.ts";
|
||||
import { getPiUserAgent } from "./utils/pi-user-agent.ts";
|
||||
import { stripBom } from "./utils/text.ts";
|
||||
import { formatVersionCheckError, getLatestPiRelease, isNewerPackageVersion } from "./utils/version-check.ts";
|
||||
import {
|
||||
cleanupWindowsSelfUpdateQuarantine,
|
||||
|
|
@ -63,7 +64,7 @@ function getActiveManagedInstallRoot(): string | undefined {
|
|||
|
||||
const markerPath = join(managedRoot, MANAGED_INSTALL_MARKER);
|
||||
try {
|
||||
const marker = JSON.parse(readFileSync(markerPath, "utf8")) as {
|
||||
const marker = JSON.parse(stripBom(readFileSync(markerPath, "utf8"))) as {
|
||||
kind?: unknown;
|
||||
layout?: unknown;
|
||||
schemaVersion?: unknown;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue