diff --git a/build/publish.ts b/build/publish.ts index 528bdf7e5f..e3ce300efa 100644 --- a/build/publish.ts +++ b/build/publish.ts @@ -41,19 +41,19 @@ const headerMap = { if (Object.keys(bumpMap).length) { for (const name in bumpMap) { console.log(`publishing ${name}@${bumpMap[name]} ...`) - await spawnAsync('yarn', ['publish', name]) + await spawnAsync(`yarn publish ${name}`) } } const { version } = require('../packages/koishi-cli/package') as PackageJson - const tags = spawnSync('git', ['tag', '-l']).split(/\r?\n/) + const tags = spawnSync('git tag -l').split(/\r?\n/) if (tags.includes(version)) { return console.log(`Tag ${version} already exists.`) } const updates = { fix: '', feat: '' } const lastTag = tags[tags.length - 1] - const commits = spawnSync('git', ['log', `${lastTag}..HEAD`, '--format="%H%s"']).split(/\r?\n/).reverse() + const commits = spawnSync(`git log ${lastTag}..HEAD --format="%H%s"`).split(/\r?\n/).reverse() for (const commit of commits) { const hash = commit.slice(0, 40) const details = /^(fix|feat)(?:\((\S+)\))?: (.+)$/.exec(commit.slice(40)) diff --git a/build/utils.ts b/build/utils.ts index 19cd9d3d60..7b7db6d613 100644 --- a/build/utils.ts +++ b/build/utils.ts @@ -20,9 +20,10 @@ export interface PackageJson extends Partial { child.on('close', resolve) })