Skip to content

Commit 475e5de

Browse files
authored
fix: --compact with --json depUrl (#347)
1 parent c02a878 commit 475e5de

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/cli/index.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,8 +221,9 @@ const main = defineCommand({
221221
await verifyCompactMode(pJson.name);
222222
}
223223

224+
const formattedSha = isCompact ? abbreviateCommitHash(sha) : sha;
224225
const depUrl = new URL(
225-
`/${owner}/${repo}/${pJson.name}@${sha}`,
226+
`/${owner}/${repo}/${pJson.name}@${formattedSha}`,
226227
apiUrl,
227228
).href;
228229
deps.set(pJson.name, depUrl);
@@ -231,7 +232,7 @@ const main = defineCommand({
231232
const resource = await fetch(depUrl);
232233
if (resource.ok) {
233234
console.warn(
234-
`${pJson.name}@${abbreviateCommitHash(sha)} was already published on ${depUrl}`,
235+
`${pJson.name}@${formattedSha} was already published on ${depUrl}`,
235236
);
236237
}
237238

0 commit comments

Comments
 (0)