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
4 changed files with 21 additions and 1 deletions

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`, {