Skip to content

Commit

Permalink
fix: allow setting default initial version per language (#251)
Browse files Browse the repository at this point in the history
  • Loading branch information
chingor13 authored and bcoe committed Aug 27, 2019
1 parent 2d5886f commit d8fff67
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/release-pr.ts
Expand Up @@ -132,12 +132,16 @@ export class ReleasePR {
}
}

protected defaultInitialVersion(): string {
return '1.0.0';
}

protected async coerceReleaseCandidate(
cc: ConventionalCommits,
latestTag: GitHubTag | undefined
): Promise<ReleaseCandidate> {
const previousTag = latestTag ? latestTag.name : undefined;
let version = latestTag ? latestTag.version : '1.0.0';
let version = latestTag ? latestTag.version : this.defaultInitialVersion();

if (latestTag && !this.releaseAs) {
const bump = await cc.suggestBump(version);
Expand Down
4 changes: 4 additions & 0 deletions src/releasers/java-yoshi.ts
Expand Up @@ -155,4 +155,8 @@ export class JavaYoshi extends ReleasePR {
candidate.version
);
}

protected defaultInitialVersion(): string {
return '0.1.0';
}
}

0 comments on commit d8fff67

Please sign in to comment.