系统设置增加依赖代理和镜像设置

This commit is contained in:
whyour
2023-11-25 21:49:33 +08:00
parent 9b7d4cb8fe
commit 3777a4e7b4
13 changed files with 455 additions and 156 deletions
+13 -5
View File
@@ -14,7 +14,7 @@ import {
import { spawn } from 'cross-spawn';
import SockService from './sock';
import { FindOptions, Op } from 'sequelize';
import { promiseExecSuccess } from '../config/util';
import { fileExist, promiseExecSuccess } from '../config/util';
import dayjs from 'dayjs';
import taskLimit from '../shared/pLimit';
@@ -252,10 +252,18 @@ export default class DependenceService {
return resolve(null);
}
}
const cp = spawn(`${depRunCommand} ${dependency.name.trim()}`, {
shell: '/bin/bash',
});
const dependenceProxyFileExist = await fileExist(
config.dependenceProxyFile,
);
const proxyStr = dependenceProxyFileExist
? `pnpm config get registry && source ${config.dependenceProxyFile} &&`
: '';
const cp = spawn(
`${proxyStr} ${depRunCommand} ${dependency.name.trim()}`,
{
shell: '/bin/bash',
},
);
cp.stdout.on('data', async (data) => {
this.sockService.sendMessage({