mirror of
https://github.com/rubickCenter/rubick
synced 2025-07-19 14:19:39 +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 = () => {
|
const resetForm = () => {
|
||||||
formState.value = {
|
formState.value = {
|
||||||
register: 'https://registry.npm.taobao.org',
|
register: 'https://registry.npmmirror.com',
|
||||||
database: 'https://gitcode.net/rubickcenter/rubick-database/-/raw/master',
|
database: 'https://gitcode.net/rubickcenter/rubick-database/-/raw/master',
|
||||||
access_token: '',
|
access_token: '',
|
||||||
};
|
};
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "rubick",
|
"name": "rubick",
|
||||||
"version": "2.4.3",
|
"version": "2.4.4",
|
||||||
"author": "muwoo <2424880409@qq.com>",
|
"author": "muwoo <2424880409@qq.com>",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
@ -52,7 +52,7 @@ class AdapterHandler {
|
|||||||
} catch (e) {
|
} catch (e) {
|
||||||
// ignore
|
// ignore
|
||||||
}
|
}
|
||||||
this.registry = register || 'https://registry.npm.taobao.org';
|
this.registry = register || 'https://registry.npmmirror.com/';
|
||||||
}
|
}
|
||||||
|
|
||||||
async upgrade(name: string): Promise<void> {
|
async upgrade(name: string): Promise<void> {
|
||||||
@ -157,14 +157,14 @@ class AdapterHandler {
|
|||||||
*/
|
*/
|
||||||
private async execCommand(cmd: string, modules: string[]): Promise<string> {
|
private async execCommand(cmd: string, modules: string[]): Promise<string> {
|
||||||
return new Promise((resolve: any, reject: any) => {
|
return new Promise((resolve: any, reject: any) => {
|
||||||
let args: string[] = [cmd]
|
const args: string[] = [cmd]
|
||||||
.concat(
|
.concat(
|
||||||
cmd !== 'uninstall' ? modules.map((m) => `${m}@latest`) : modules
|
cmd !== 'uninstall' ? modules.map((m) => `${m}@latest`) : modules
|
||||||
)
|
)
|
||||||
.concat('--color=always')
|
.concat('--color=always')
|
||||||
.concat('--save');
|
.concat('--save')
|
||||||
if (cmd !== 'uninstall')
|
.concat(`--registry=${this.registry}`);
|
||||||
args = args.concat(`--registry=${this.registry}`);
|
|
||||||
const npm = spawn('npm', args, {
|
const npm = spawn('npm', args, {
|
||||||
cwd: this.baseDir,
|
cwd: this.baseDir,
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user