mirror of
https://github.com/whyour/qinglong.git
synced 2025-05-22 22:36:06 +08:00
修复设置 nodejs 镜像源
This commit is contained in:
parent
b31eab02d7
commit
74916670eb
|
@ -29,6 +29,7 @@ import tar from 'tar';
|
|||
import path from 'path';
|
||||
import fs from 'fs';
|
||||
import sum from 'lodash/sum';
|
||||
import { DependenceModel, DependenceStatus, DependenceTypes } from '../data/dependence';
|
||||
|
||||
@Service()
|
||||
export default class SystemService {
|
||||
|
@ -136,7 +137,13 @@ export default class SystemService {
|
|||
if (info.nodeMirror) {
|
||||
cmd = `pnpm config set registry ${info.nodeMirror}`;
|
||||
}
|
||||
const command = `cd && ${cmd} && pnpm i -g`;
|
||||
let command = `cd && ${cmd}`;
|
||||
const docs = await DependenceModel.findAll({
|
||||
where: { type: DependenceTypes.nodejs, status: DependenceStatus.installed },
|
||||
});
|
||||
if (docs.length > 0) {
|
||||
command += ` && pnpm i -g`;
|
||||
}
|
||||
this.scheduleService.runTask(
|
||||
command,
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue
Block a user