Skip to content

Commit b1a010b

Browse files
committed
fix publish need package path
1 parent 909c198 commit b1a010b

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

scripts/release/publish-npm.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ async function publishNpm() {
4848
throw new Error('NPM_TOKEN is not set')
4949
}
5050

51-
const packageDirs = await readdir(join(process.cwd(), 'packages'), {
51+
const packagesDir = join(process.cwd(), 'packages')
52+
const packageDirs = await readdir(packagesDir, {
5253
withFileTypes: true,
5354
})
5455

@@ -83,9 +84,13 @@ async function publishNpm() {
8384
version: pkgJson.version,
8485
})
8586

86-
await execa('pnpm', ['publish', '--tag', tag], {
87-
stdio: 'inherit',
88-
})
87+
const packagePath = join(packagesDir, packageDir.name)
88+
const args = ['publish', packagePath, '--tag', tag]
89+
90+
console.log(
91+
`Running command: "pnpm ${args.join(' ')}" for ${pkgJson.name}@${pkgJson.version}`
92+
)
93+
await execa('pnpm', args, { stdio: 'inherit' })
8994
}
9095
}
9196

0 commit comments

Comments
 (0)