mirror of
https://github.com/jakejarvis/hugo-extended.git
synced 2025-04-27 02:18:27 -04:00
discouraged by official docs, see: https://nodejs.org/api/process.html#process_process_exit_code
16 lines
369 B
JavaScript
Executable File
16 lines
369 B
JavaScript
Executable File
#!/usr/bin/env node
|
|
|
|
import { spawn } from "child_process";
|
|
import hugo from "../index.js";
|
|
|
|
(async () => {
|
|
const args = process.argv.slice(2);
|
|
const bin = await hugo();
|
|
|
|
spawn(bin, args, { stdio: "inherit" })
|
|
.on("exit", (code) => {
|
|
// forward Hugo's exit code so this module itself reports success/failure
|
|
process.exitCode = code;
|
|
});
|
|
})();
|