2022-09-28 13:04:16 -04:00
|
|
|
const path = require("path");
|
|
|
|
|
|
|
|
function childProcessFork(path) {
|
2024-01-16 20:18:19 -05:00
|
|
|
const command = new Deno.Command(Deno.execPath(), {
|
2024-01-23 09:33:07 -05:00
|
|
|
args: ["run", "-A", path],
|
2022-09-28 13:04:16 -04:00
|
|
|
env: {
|
2023-01-24 12:54:10 -05:00
|
|
|
"DENO_DONT_USE_INTERNAL_NODE_COMPAT_STATE": Deno[Deno.internal].core.ops.op_npm_process_state(),
|
2022-09-28 13:04:16 -04:00
|
|
|
}
|
|
|
|
});
|
2024-01-16 20:18:19 -05:00
|
|
|
const child = command.spawn();
|
|
|
|
child.status.then(() => {
|
2022-09-28 13:04:16 -04:00
|
|
|
console.log("Done.");
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
run() {
|
|
|
|
childProcessFork(path.join(__dirname, "forked_path.js"));
|
|
|
|
}
|
|
|
|
};
|