Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions scripts/repo/stage-publish-cli-exe.mts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ function resolveTriplets(spec: string): readonly CliExeTriplet[] | undefined {
const parts = spec.split(',').map(part => part.trim())
const triplets: CliExeTriplet[] = []
for (let i = 0, { length } = parts; i < length; i += 1) {
const part = parts[i]!
const part = parts[i]
if (!isCliExeTriplet(part)) {
logger.error(
`Unknown triplet "${part}" — expected one of: ${CLI_EXE_TRIPLETS.join(', ')}, or all/buildable`,
Expand Down Expand Up @@ -190,9 +190,7 @@ async function stageTarget(
} catch (e) {
// Non-zero exits reject; the error carries the exit code.
const errCode =
e && typeof e === 'object' && 'code' in e
? (e as { code: unknown }).code
: undefined
e && typeof e === 'object' && 'code' in e ? e.code : undefined
code = typeof errCode === 'number' ? errCode : 1
}
if (code !== 0) {
Expand Down Expand Up @@ -267,7 +265,7 @@ async function main(): Promise<void> {

let ok = true
for (let i = 0, { length } = targets; i < length; i += 1) {
const target = targets[i]!
const target = targets[i]
ok = guardTarget(target, version) && ok
}
if (!ok) {
Expand All @@ -282,14 +280,14 @@ async function main(): Promise<void> {
`Plan (${dryRun ? 'dry-run' : 'PUBLISH'}, tag=${tag}, version=${version}):`,
)
for (let i = 0, { length } = targets; i < length; i += 1) {
const target = targets[i]!
const target = targets[i]
logger.log(` ${target.name}@${version} <- ${target.dir}`)
}
return
}

for (let i = 0, { length } = targets; i < length; i += 1) {
const target = targets[i]!
const target = targets[i]
// eslint-disable-next-line no-await-in-loop
const staged = await stageTarget(target, { dryRun, tag })
if (!staged) {
Expand Down