forked from mercurjs/mercur
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
executable file
·31 lines (25 loc) · 787 Bytes
/
index.js
File metadata and controls
executable file
·31 lines (25 loc) · 787 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
27
28
29
30
31
#!/usr/bin/env node
const { spawn } = require("child_process");
const path = require("path");
try {
// Get the directory where this script is located
const scriptDir = __dirname;
// Change to the mercur directory
process.chdir(scriptDir);
console.log(`Starting Mercur development server from: ${scriptDir}`);
// Start the development server
const child = spawn("yarn", ["dev"], {
stdio: "inherit",
shell: true,
});
child.on("error", (error) => {
console.error("Failed to start Mercur development server:", error.message);
console.log(
"Make sure yarn is installed and all dependencies are properly installed."
);
process.exit(1);
});
} catch (error) {
console.error("Error starting Mercur:", error.message);
process.exit(1);
}