Skip to content

Commit

Permalink
🔧 Improve china mirroring speed
Browse files Browse the repository at this point in the history
  • Loading branch information
tw93 committed May 9, 2024
1 parent bb3b1b3 commit 4df5a66
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
4 changes: 2 additions & 2 deletions bin/builders/BaseBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export default abstract class BaseBuilder {
const isChina = await isChinaDomain('www.npmjs.com');
const spinner = getSpinner('Installing package...');
const rustProjectDir = path.join(tauriSrcPath, '.cargo');
const projectConf = path.join(rustProjectDir, 'config');
const projectConf = path.join(rustProjectDir, 'config.toml');
await fsExtra.ensureDir(rustProjectDir);

if (isChina) {
Expand All @@ -73,7 +73,7 @@ export default abstract class BaseBuilder {

async start(url: string) {
await mergeConfig(url, this.options, tauriConfig);
}
}

async buildAndCopy(url: string, target: string) {
const { name } = this.options;
Expand Down
6 changes: 1 addition & 5 deletions src-tauri/rust_proxy.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
[source.crates-io]
# To use sparse index, change 'rsproxy' to 'rsproxy-sparse'
replace-with = 'rsproxy'

replace-with = 'rsproxy-sparse'
[source.rsproxy]
registry = "https://rsproxy.cn/crates.io-index"
[source.rsproxy-sparse]
registry = "sparse+https://rsproxy.cn/index/"

[registries.rsproxy]
index = "https://rsproxy.cn/crates.io-index"

[net]
git-fetch-with-cli = true

0 comments on commit 4df5a66

Please sign in to comment.