61 lines
1.7 KiB
JavaScript
61 lines
1.7 KiB
JavaScript
import { spawnSync } from "node:child_process";
|
|
import { access } from "node:fs/promises";
|
|
import { dirname, join } from "node:path";
|
|
import { fileURLToPath } from "node:url";
|
|
|
|
const root = join(dirname(fileURLToPath(import.meta.url)), "..");
|
|
|
|
const pathExists = async (path) => {
|
|
try {
|
|
await access(path);
|
|
return true;
|
|
} catch (cause) {
|
|
if (
|
|
typeof cause === "object" &&
|
|
cause !== null |