mirror of
https://github.com/rubickCenter/rubick
synced 2025-07-19 06:09:41 +08:00
🐛 修复插件安装镜像地址问题:https://zhuanlan.zhihu.com/p/432578145
This commit is contained in:
parent
637c1238ae
commit
62bcc345da
@ -80,7 +80,7 @@ const layout = {
|
||||
|
||||
const resetForm = () => {
|
||||
formState.value = {
|
||||
register: 'https://registry.npm.taobao.org',
|
||||
register: 'https://registry.npmmirror.com',
|
||||
database: 'https://gitcode.net/rubickcenter/rubick-database/-/raw/master',
|
||||
access_token: '',
|
||||
};
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "rubick",
|
||||
"version": "2.4.3",
|
||||
"version": "2.4.4",
|
||||
"author": "muwoo <2424880409@qq.com>",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
|
@ -52,7 +52,7 @@ class AdapterHandler {
|
||||
} catch (e) {
|
||||
// ignore
|
||||
}
|
||||
this.registry = register || 'https://registry.npm.taobao.org';
|
||||
this.registry = register || 'https://registry.npmmirror.com/';
|
||||
}
|
||||
|
||||
async upgrade(name: string): Promise<void> {
|
||||
@ -157,14 +157,14 @@ class AdapterHandler {
|
||||
*/
|
||||
private async execCommand(cmd: string, modules: string[]): Promise<string> {
|
||||
return new Promise((resolve: any, reject: any) => {
|
||||
let args: string[] = [cmd]
|
||||
const args: string[] = [cmd]
|
||||
.concat(
|
||||
cmd !== 'uninstall' ? modules.map((m) => `${m}@latest`) : modules
|
||||
)
|
||||
.concat('--color=always')
|
||||
.concat('--save');
|
||||
if (cmd !== 'uninstall')
|
||||
args = args.concat(`--registry=${this.registry}`);
|
||||
.concat('--save')
|
||||
.concat(`--registry=${this.registry}`);
|
||||
|
||||
const npm = spawn('npm', args, {
|
||||
cwd: this.baseDir,
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user