@sciagent/cli 1.1.51 → 1.1.52
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/sciagent.js +1 -1
- package/package.json +1 -1
- package/scripts/postinstall.js +11 -5
package/bin/sciagent.js
CHANGED
|
@@ -25,7 +25,7 @@ const https = require('https');
|
|
|
25
25
|
const http = require('http');
|
|
26
26
|
|
|
27
27
|
// 当前版本号 - 与 postinstall.js 和 package.json 保持同步
|
|
28
|
-
const CURRENT_VERSION = '1.1.
|
|
28
|
+
const CURRENT_VERSION = '1.1.52';
|
|
29
29
|
|
|
30
30
|
// Releases 下载源配置(优先级从高到低)
|
|
31
31
|
// JihuLab 通用包仓库(国内 CDN,速度快)作为主源
|
package/package.json
CHANGED
package/scripts/postinstall.js
CHANGED
|
@@ -27,7 +27,7 @@ const ARCH_MAP = {
|
|
|
27
27
|
};
|
|
28
28
|
|
|
29
29
|
// 当前版本号 - 每次发布时同步更新
|
|
30
|
-
const CURRENT_VERSION = '1.1.
|
|
30
|
+
const CURRENT_VERSION = '1.1.52';
|
|
31
31
|
|
|
32
32
|
// GitHub Releases 回退版本列表(当当前版本的 release 不存在时尝试)
|
|
33
33
|
const GITHUB_FALLBACK_VERSIONS = ['1.1.3', '1.0.50', '1.0.48', '1.0.46', '1.0.40', '1.0.38', '1.0.36'];
|
|
@@ -736,17 +736,23 @@ async function downloadFromServer(platform, arch, version) {
|
|
|
736
736
|
'$ProgressPreference = "SilentlyContinue"',
|
|
737
737
|
`$uri = "${source.url}"`,
|
|
738
738
|
`$out = "${tempPath}"`,
|
|
739
|
-
'Write-Host " Downloading..."',
|
|
739
|
+
'Write-Host " Downloading from ' + source.name + '..."',
|
|
740
740
|
];
|
|
741
741
|
|
|
742
742
|
if (source.auth === 'jihulab') {
|
|
743
743
|
const b64 = Buffer.from(`${JIHULAB_DEPLOY_TOKEN_USER}:${JIHULAB_DEPLOY_TOKEN}`).toString('base64');
|
|
744
744
|
scriptLines.push(`$headers = @{ "Authorization" = "Basic ${b64}" }`);
|
|
745
|
-
|
|
745
|
+
// Use WebClient for large files - much faster than Invoke-WebRequest
|
|
746
|
+
scriptLines.push('$wc = New-Object System.Net.WebClient');
|
|
747
|
+
scriptLines.push('$wc.Headers.Add("Authorization", $headers["Authorization"])');
|
|
748
|
+
scriptLines.push('Write-Host " Using JihuLab CDN with auth..."');
|
|
749
|
+
scriptLines.push('$wc.DownloadFile($uri, $out)');
|
|
746
750
|
} else {
|
|
747
|
-
scriptLines.push('
|
|
751
|
+
scriptLines.push('$wc = New-Object System.Net.WebClient');
|
|
752
|
+
scriptLines.push('Write-Host " Using ' + source.name + '..."');
|
|
753
|
+
scriptLines.push('$wc.DownloadFile($uri, $out)');
|
|
748
754
|
}
|
|
749
|
-
scriptLines.push('if (Test-Path $out) { $s = (Get-Item $out).Length; Write-Host " Downloaded: $s bytes" } else { Write-Error "File not created"; exit 1 }');
|
|
755
|
+
scriptLines.push('if (Test-Path $out) { $s = (Get-Item $out).Length; Write-Host " Downloaded: $s bytes ($([math]::Round($s/1MB,1)) MB)" } else { Write-Error "File not created"; exit 1 }');
|
|
750
756
|
|
|
751
757
|
fs.writeFileSync(tmpScript, scriptLines.join('\r\n'), 'utf8');
|
|
752
758
|
|