diff --git a/back/data/dependence.ts b/back/data/dependence.ts index 5809e736..5db9c297 100644 --- a/back/data/dependence.ts +++ b/back/data/dependence.ts @@ -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 || ''; } diff --git a/back/services/dependence.ts b/back/services/dependence.ts index 8e2638e1..2e440ec3 100644 --- a/back/services/dependence.ts +++ b/back/services/dependence.ts @@ -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 diff --git a/shell/share.sh b/shell/share.sh index d2be9f62..9cbc7955 100755 --- a/shell/share.sh +++ b/shell/share.sh @@ -313,8 +313,8 @@ reload_pm2() { # 代理会影响 grpc 服务 unset_proxy pm2 flush &>/dev/null - pm2 kill &>/dev/null - pm2 startOrGracefulReload $file_ecosystem_js + pm2 startOrGracefulReload $file_ecosystem_js --update-env + pm2 sendSignal SIGKILL panel &>/dev/null } diff_time() {