修复 pm2 重启逻辑

This commit is contained in:
whyour
2023-07-17 13:25:56 +08:00
parent 93e94ea94c
commit bd166ee794
3 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -18,7 +18,7 @@ export class Dependence {
: DependenceStatus.queued;
this.type = options.type || DependenceTypes.nodejs;
this.timestamp = new Date().toString();
this.name = options.name;
this.name = options.name.trim();
this.log = options.log || [];
this.remark = options.remark || '';
}
+2 -2
View File
@@ -168,7 +168,7 @@ export default class DependenceService {
const socketMessageType = isInstall
? 'installDependence'
: 'uninstallDependence';
const depName = dependency.name;
const depName = dependency.name.trim();
const depRunCommand = (
isInstall
? InstallDependenceCommandTypes
@@ -191,7 +191,7 @@ export default class DependenceService {
if (isInstall) {
const getCommandPrefix = GetDependenceCommandTypes[dependency.type];
const depVersionStr = versionDependenceCommandTypes[dependency.type];
const [_depName] = dependency.name.split(depVersionStr);
const [_depName] = dependency.name.trim().split(depVersionStr);
const depInfo = (
await promiseExecSuccess(
dependency.type === DependenceTypes.linux