fix: add -Encoding ASCII to Set-Content to prevent npm auth BOM issue

这个提交包含在:
XuqmGroup 2026-05-16 12:41:43 +08:00
父节点 e9b3a39ae0
当前提交 a68550e576

2
Jenkinsfile vendored
查看文件

@ -68,7 +68,7 @@ pipeline {
steps {
withCredentials([usernamePassword(credentialsId: 'NEXUS_CREDS', passwordVariable: 'NPM_PASS', usernameVariable: 'NPM_USER')]) {
bat """
powershell -NonInteractive -Command "Set-Content .npmrc ('//nexus.xuqinmin.com/repository/npm-hosted/:_auth=' + [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(\$env:NPM_USER + ':' + \$env:NPM_PASS)))"
powershell -NonInteractive -Command "Set-Content .npmrc ('//nexus.xuqinmin.com/repository/npm-hosted/:_auth=' + [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(\$env:NPM_USER + ':' + \$env:NPM_PASS))) -Encoding ASCII"
npm publish --registry %NEXUS_REGISTRY%
"""
}