mirror of
https://gitee.com/nocobase/nocobase.git
synced 2024-12-02 12:18:15 +08:00
fix: delete sock files before nocobase start
This commit is contained in:
parent
651af7d741
commit
3445001540
@ -1,9 +1,19 @@
|
||||
const { Command } = require('commander');
|
||||
const { isDev, run, postCheck, runInstall, promptForTs } = require('../util');
|
||||
const { existsSync, unlink } = require('fs');
|
||||
const { existsSync, rmSync } = require('fs');
|
||||
const { resolve } = require('path');
|
||||
const chalk = require('chalk');
|
||||
|
||||
function deleteSockFiles() {
|
||||
const { SOCKET_PATH, PM2_HOME } = process.env;
|
||||
if (existsSync(PM2_HOME)) {
|
||||
rmSync(PM2_HOME, { recursive: true });
|
||||
}
|
||||
if (existsSync(SOCKET_PATH)) {
|
||||
rmSync(SOCKET_PATH);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {Command} cli
|
||||
@ -41,6 +51,7 @@ module.exports = (cli) => {
|
||||
return;
|
||||
}
|
||||
await postCheck(opts);
|
||||
deleteSockFiles();
|
||||
if (opts.daemon) {
|
||||
run('pm2', ['start', `${APP_PACKAGE_ROOT}/lib/index.js`, '--', ...process.argv.slice(2)]);
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user