mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-07-09 17:19:02 +00:00
fix(release): move constants above entry point to avoid TDZ error (#4398)
MAX_UPLOAD_ATTEMPTS and INITIAL_BACKOFF_MS were declared after the isMainModule() guard that calls main(). In ES modules, const bindings are not initialized until the declaration is reached, so the runtime threw "Cannot access 'MAX_UPLOAD_ATTEMPTS' before initialization" during the Release workflow.
This commit is contained in:
parent
e43852f769
commit
a41afc465d
1 changed files with 3 additions and 3 deletions
|
|
@ -10,6 +10,9 @@ import path from 'node:path';
|
|||
import { spawnSync } from 'node:child_process';
|
||||
import { fail, isMainModule, readOptionValue } from './release-script-utils.js';
|
||||
|
||||
const MAX_UPLOAD_ATTEMPTS = 3;
|
||||
const INITIAL_BACKOFF_MS = 2000;
|
||||
|
||||
if (isMainModule(import.meta.url)) {
|
||||
try {
|
||||
main(process.argv.slice(2));
|
||||
|
|
@ -96,9 +99,6 @@ function parseUploadArgs(argv) {
|
|||
return args;
|
||||
}
|
||||
|
||||
const MAX_UPLOAD_ATTEMPTS = 3;
|
||||
const INITIAL_BACKOFF_MS = 2000;
|
||||
|
||||
function uploadAssets(
|
||||
{ assets, bucket, config, prefix },
|
||||
{ ossutilCommand = 'ossutil', ossutilCommandArgs = [] } = {},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue