forked from Wyliemaster/gddocs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgenerator.js
More file actions
26 lines (19 loc) · 734 Bytes
/
generator.js
File metadata and controls
26 lines (19 loc) · 734 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// eslint-disable-next-line no-console
import { exec } from 'child_process';
import os from 'os';
// Import local script as an ES module
import './scripts/installPackages.js';
// Define the command to serve documentation
let command = "node ./node_modules/docsify-cli/bin/docsify serve ./docs --port 9505";
if (os.platform() === "win32") {
// Adjust command for Windows
command = "node \"./node_modules/docsify-cli/bin/docsify\" serve ./docs --port 9505";
}
console.log(`${("Running Command: ")} ${command}\n`);
// Execute the command
const docsProcess = exec(command);
if(docsProcess.exitCode === null) {
console.log("http://localhost:9505")
}
docsProcess.on("exit", () => process.exit(0));
// Handle process exit