mirror of
https://github.com/QYG2297248353/IYUUPlus-Windows.git
synced 2025-12-29 08:01:35 +08:00
feat 菜单功能
This commit is contained in:
+12
-2
@@ -22,9 +22,14 @@ function startServer() {
|
||||
const args = ['./iyuu/windows.php'];
|
||||
const workingDirectory = path.resolve(__dirname, '..');
|
||||
|
||||
const env = { ...process.env };
|
||||
const phpDir = path.dirname(cmdPath);
|
||||
env.PATH = `${phpDir}${path.delimiter}${env.PATH}`;
|
||||
|
||||
serverProcess = spawn(cmdPath, args, {
|
||||
cwd: workingDirectory,
|
||||
stdio: ['inherit', 'pipe', 'inherit']
|
||||
stdio: ['inherit', 'pipe', 'inherit'],
|
||||
env: env
|
||||
});
|
||||
|
||||
serverProcess.stdout.setEncoding('utf8');
|
||||
@@ -53,4 +58,9 @@ function stopServer() {
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = { startServer, stopServer };
|
||||
function restartServer() {
|
||||
stopServer();
|
||||
startServer();
|
||||
}
|
||||
|
||||
module.exports = { startServer, stopServer, restartServer };
|
||||
Reference in New Issue
Block a user