fix: update bun to 1.1.27

This commit is contained in:
Ruben Fiszel
2024-09-17 10:27:51 +02:00
parent 375f37741b
commit ae6103569a
6 changed files with 32 additions and 11 deletions
+12
View File
@@ -145,6 +145,17 @@ const command = new Command()
.command("completions", new CompletionsCommand());
export let showDiffs = false;
let isWin: boolean | undefined = undefined;
export async function getIsWin() {
if (isWin === undefined) {
const os = await import("node:os");
isWin = os.platform() === "win32";
}
return isWin;
}
async function main() {
try {
if (Deno.args.length === 0) {
@@ -161,6 +172,7 @@ async function main() {
handlers: {
console: new log.ConsoleHandler(LOG_LEVEL, {
formatter: ({ msg }) => `${msg}`,
useColors: isWin ? false : true,
}),
},
loggers: {
+14 -3
View File
@@ -42,6 +42,7 @@ import {
import { generateHash, readInlinePathSync } from "./utils.ts";
import { SyncCodebase } from "./codebase.ts";
import { FlowFile, replaceInlineScripts } from "./flow.ts";
import { getIsWin } from "./main.ts";
export async function generateAllMetadata() {}
@@ -169,6 +170,12 @@ export async function generateFlowLockInternal(
log.info(colors.green(`Flow ${remote_path} lockfiles updated`));
}
// on windows, when using powershell, blue is not readable
async function blueColor(): Promise<(x: string) => void> {
const isWin = await getIsWin();
return isWin ? colors.black : colors.blue;
}
export async function generateScriptMetadataInternal(
scriptPath: string,
workspace: Workspace,
@@ -196,7 +203,7 @@ export async function generateScriptMetadataInternal(
);
if (rawReqs) {
log.info(
colors.blue(
(await blueColor())(
`Found raw requirements (package.json/requirements.txt/composer.json) for ${scriptPath}, using it`
)
);
@@ -786,7 +793,9 @@ export async function parseMetadataFile(
} catch {
// no metadata file at all. Create it
log.info(
colors.blue(`Creating script metadata file for ${metadataFilePath}`)
(await blueColor())(
`Creating script metadata file for ${metadataFilePath}`
)
);
metadataFilePath = scriptPath + ".script.yaml";
let scriptInitialMetadata = defaultScriptMetadata();
@@ -800,7 +809,9 @@ export async function parseMetadataFile(
if (generateMetadataIfMissing) {
log.info(
colors.blue(`Generating lockfile and schema for ${metadataFilePath}`)
(await blueColor())(
`Generating lockfile and schema for ${metadataFilePath}`
)
);
try {
await generateScriptMetadataInternal(