···77import { version } from "../package.json" with { type: "json" };
8899import dotenv from "dotenv";
1010-import { isCI } from "std-env";
1111-if (!("Bun" in globalThis)) dotenv.config({ quiet: true });
1010+import { isBun, isCI } from "std-env";
1111+if (!isBun) dotenv.config({ quiet: true });
12121313const consolaOptions = consola.options;
1414consolaOptions.formatOptions.date = false;
+1-2
src/commands/sync-cmd.ts
···278278 const frontmatter = ast.children.find((val) => val.type == "yaml");
279279 if (!frontmatter) throw new Error(`Could not find frontmatter for ${file}`);
280280281281- const frontmatterData =
282282- "Bun" in globalThis ? (Bun.YAML.parse(frontmatter.value) as any) : parse(frontmatter.value);
281281+ const frontmatterData = isBun ? (Bun.YAML.parse(frontmatter.value) as any) : parse(frontmatter.value);
283282 if (!frontmatterData[config.frontmatter.titleKey])
284283 throw new Error(`Could not find title in frontmatter for ${file}`);
285284 title = frontmatterData[config.frontmatter.titleKey];
+2-1
src/utils.ts
···22import { createJiti } from "jiti";
33import { join } from "node:path";
44import type { Config } from "./config";
55+import { isBun } from "std-env";
5667export const jiti = createJiti(import.meta.url);
78···1516}
16171718export async function readJson(path: string | URL) {
1818- if ("Bun" in globalThis) return await Bun.file(path).json();
1919+ if (isBun) return await Bun.file(path).json();
19202021 return JSON.parse((await readFile(path)).toString());
2122}