2024-01-02 16:31:30 +00:00
|
|
|
"use strict";
|
|
|
|
|
|
|
|
const promisify = require("util").promisify;
|
|
|
|
const fs = require("fs");
|
|
|
|
const path = require("path");
|
|
|
|
const child_process = require("child_process");
|
|
|
|
|
|
|
|
const filepath_moondoc = path.resolve(__dirname, `../node_modules/.bin/moondoc`);
|
|
|
|
const dirpath_root = path.resolve(__dirname, `../..`);
|
|
|
|
|
|
|
|
module.exports = function moondoc_runner(filepath_output) {
|
|
|
|
const dirpath = path.dirname(filepath_output);
|
|
|
|
if(!fs.existsSync(dirpath)) {
|
|
|
|
fs.mkdirSync(dirpath, { recursive: true });
|
|
|
|
}
|
|
|
|
|
|
|
|
child_process.execFileSync(filepath_moondoc, [
|
|
|
|
"build",
|
|
|
|
"--input", dirpath_root,
|
2024-01-02 17:05:06 +00:00
|
|
|
"--output", filepath_output,
|
|
|
|
"--branch", "dev"
|
2024-01-02 16:31:30 +00:00
|
|
|
]);
|
|
|
|
}
|