@softwareventures/maintain-project
Version:
Automatically create and maintain TypeScript projects with standard settings for Software Ventures Limited
23 lines • 847 B
JavaScript
import { fork } from "child_process";
import { dirname, resolve as resolvePath } from "path";
import { fileURLToPath } from "url";
import { failure, success } from "../result/result.js";
export async function yarn(project, ...args) {
return new Promise((resolve, reject) => {
fork(resolvePath(dirname(fileURLToPath(import.meta.resolve("corepack/package.json"))), "dist/corepack.js"), ["yarn", ...args], {
cwd: project.path,
stdio: "ignore",
env: { COREPACK_ENABLE_DOWNLOAD_PROMPT: "0" }
})
.on("error", reject)
.on("exit", code => {
if (code === 0) {
resolve(success());
}
else {
resolve(failure([{ type: "yarn-failed", code }]));
}
});
});
}
//# sourceMappingURL=yarn.js.map