Skip to content

Commit

Permalink
feat: update release scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
shaobeichen committed Nov 1, 2024
1 parent f8e328a commit 74d070c
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions scripts/release.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,17 @@ try {
// 获取子文件夹
const folders = fs.readdirSync(npmDir)

// 设置 npm 认证 token
const npmToken = process.env.NPM_TOKEN // 从环境变量中获取 token
if (npmToken) {
execSync(`npm config set //registry.npmjs.org/:_authToken=${npmToken}`, {
stdio: 'inherit',
})
} else {
console.error('请设置 NPM_TOKEN 环境变量.')
process.exit(1)
}

// 遍历每个子文件夹
folders.forEach((folder) => {
const folderPath = path.join(npmDir, folder)
Expand Down

0 comments on commit 74d070c

Please sign in to comment.