fix: use scalar Set-Content with [char]10 newline for two-line .npmrc to avoid BOM and array issues

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

4
Jenkinsfile vendored
查看文件

@ -39,7 +39,7 @@ pipeline {
steps {
withCredentials([usernamePassword(credentialsId: 'NEXUS_CREDS', passwordVariable: 'NPM_PASS', usernameVariable: 'NPM_USER')]) {
bat """
powershell -NonInteractive -Command "\$auth=[Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(\$env:NPM_USER+':'+\$env:NPM_PASS)); @('@xuqm:registry=https://nexus.xuqinmin.com/repository/npm-hosted/','//nexus.xuqinmin.com/repository/npm-hosted/:_auth='+\$auth) | Set-Content .npmrc"
powershell -NonInteractive -Command "\$auth=[Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(\$env:NPM_USER+':'+\$env:NPM_PASS)); Set-Content .npmrc ('@xuqm:registry=https://nexus.xuqinmin.com/repository/npm-hosted/' + [char]10 + '//nexus.xuqinmin.com/repository/npm-hosted/:_auth=' + \$auth) -Encoding ASCII"
npm install --legacy-peer-deps
"""
}
@ -67,7 +67,7 @@ pipeline {
steps {
withCredentials([usernamePassword(credentialsId: 'NEXUS_CREDS', passwordVariable: 'NPM_PASS', usernameVariable: 'NPM_USER')]) {
bat """
powershell -NonInteractive -Command "\$auth=[Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(\$env:NPM_USER+':'+\$env:NPM_PASS)); @('@xuqm:registry=https://nexus.xuqinmin.com/repository/npm-hosted/','//nexus.xuqinmin.com/repository/npm-hosted/:_auth='+\$auth) | Set-Content .npmrc"
powershell -NonInteractive -Command "\$auth=[Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(\$env:NPM_USER+':'+\$env:NPM_PASS)); Set-Content .npmrc ('@xuqm:registry=https://nexus.xuqinmin.com/repository/npm-hosted/' + [char]10 + '//nexus.xuqinmin.com/repository/npm-hosted/:_auth=' + \$auth) -Encoding ASCII"
npm publish --workspaces --registry %NEXUS_REGISTRY%
"""
}