mcfly/packages/cli/commands/build.mjs
Ayo Ayco 56592bdeef
test(cli): add tests for cli commands (#37)
* chore(cli): add vitest & add test script

* chore: add test:cli script

* test(cli): initial tests for build command

* chore(cli): add nitropack as devDepencency for tests

* chore(cli): add vitest config

* test(cli): add tests for build command

* test(cli): add tests for new command
2024-12-07 02:44:38 +01:00

32 lines
No EOL
640 B
JavaScript

#!/usr/bin/env node
import { consola } from "consola";
import { defineCommand } from "citty";
import { execSync } from "node:child_process";
function build() {
consola.start("Building project...");
console.log('jfklsdjfklds')
try {
execSync(`npx nitropack build`, { stdio: "inherit" });
console.log('called build')
} catch (err) {
console.log('hyeyyy err9r')
consola.error(err);
}
}
export default defineCommand({
meta: {
name: "prepare",
description: "Builds the McFly project for production.",
},
async run() {
build()
},
});
export const exportedForTest = {
build,
}