chore: support http proxy in bump script (#8098)

This commit is contained in:
Yifeng Wang 2024-09-05 10:14:51 +08:00 committed by GitHub
parent 93ae724c66
commit 416faba2bc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 21 additions and 1 deletions

View File

@ -0,0 +1,13 @@
# Bump BlockSuite
To update BlockSuite, run following command in project root:
```sh
node scripts/bump-blocksuite.js
```
For network issue, try setting proxy environment variables:
```sh
export http_proxy=http://127.0.0.1:7890
```

View File

@ -11,6 +11,7 @@ import {
Sort,
} from '@napi-rs/simple-git';
import chalk from 'chalk';
import { ProxyAgent, setGlobalDispatcher } from 'undici';
import corePackage from '../../packages/frontend/core/package.json' assert { type: 'json' };
@ -32,6 +33,10 @@ if (oldHash === latestHash) {
process.exit(0);
}
if (process.env.http_proxy) {
setGlobalDispatcher(new ProxyAgent(process.env.http_proxy));
}
console.info(`Upgrade blocksuite from ${oldHash} -> ${latestHash}`);
const blockSuiteDeps = execSync(`yarn info -A --name-only --json`, {

View File

@ -8,6 +8,7 @@
"dependencies": {
"@napi-rs/clipboard": "^1.1.2",
"@napi-rs/simple-git": "^0.1.18",
"chalk": "^5.3.0"
"chalk": "^5.3.0",
"undici": "^6.12.0"
}
}

View File

@ -228,6 +228,7 @@ __metadata:
"@napi-rs/clipboard": "npm:^1.1.2"
"@napi-rs/simple-git": "npm:^0.1.18"
chalk: "npm:^5.3.0"
undici: "npm:^6.12.0"
languageName: unknown
linkType: soft