Skip to content

Commit d046aaa

Browse files
committed
Only get the current commit if the template uses the {commit} variable
1 parent 5b9d69f commit d046aaa

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

  • packages/cli/src/commands/version

‎packages/cli/src/commands/version/index.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,9 @@ export default async function version(
7474
options.snapshot
7575
? {
7676
tag: options.snapshot === true ? undefined : options.snapshot,
77-
commit: await getCurrentCommitId({ cwd })
77+
commit: config.snapshot.prereleaseTemplate?.includes("{commit}")
78+
? await getCurrentCommitId({ cwd })
79+
: undefined
7880
}
7981
: undefined
8082
);

0 commit comments

Comments
 (0)