mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-10-25 08:03:45 +00:00
feat: auto-strip UTF-8 BOM when reading local files in CLI (#8911)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.5
parent
dc896737ac
commit
99bc96d0b2
@@ -1,4 +1,5 @@
|
||||
import { readFile, writeFile, open as fsOpen } from "node:fs/promises";
|
||||
import { writeFile, open as fsOpen } from "node:fs/promises";
|
||||
import { readTextFile } from "../../utils/utils.ts";
|
||||
import process from "node:process";
|
||||
import { GlobalOptions } from "../../types.ts";
|
||||
import {
|
||||
@@ -31,7 +32,7 @@ export async function allWorkspaces(
|
||||
): Promise<Workspace[]> {
|
||||
try {
|
||||
const file = await getWorkspaceConfigFilePath(configDirOverride);
|
||||
const txt = await readFile(file, "utf-8");
|
||||
const txt = await readTextFile(file);
|
||||
return txt
|
||||
.split("\n")
|
||||
.map((line) => {
|
||||
@@ -55,7 +56,7 @@ async function getActiveWorkspaceName(
|
||||
}
|
||||
try {
|
||||
const file = await getActiveWorkspaceConfigFilePath(opts?.configDir);
|
||||
return await readFile(file, "utf-8");
|
||||
return await readTextFile(file);
|
||||
} catch {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user