Skip to content

Commit

Permalink
PR review
Browse files Browse the repository at this point in the history
  • Loading branch information
Etienne St-Pierre authored and Etienne St-Pierre committed Dec 19, 2023
1 parent 5cad54c commit 5f33ace
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 9 deletions.
4 changes: 2 additions & 2 deletions cli/src/commands/stats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ export default class Stats extends Command {
async run() {
const {flags} = this.parse(Stats);

if (this.projectConfig.config.version?.identifier && !flags.version) {
flags.version = this.projectConfig.config.version.identifier;
if (this.projectConfig.config.version?.tag && !flags.version) {
flags.version = this.projectConfig.config.version.tag;
}

if (flags.version) {
Expand Down
2 changes: 1 addition & 1 deletion cli/src/commands/sync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export default class Sync extends Command {
const t0 = process.hrtime.bigint();
const documents = this.projectConfig.files();

if (this.projectConfig.config.version?.identifier && !flags.version) {
if (this.projectConfig.config.version?.tag && !flags.version) {
flags.version = this.config.version;
}

Expand Down
8 changes: 3 additions & 5 deletions cli/src/services/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,12 @@ export default class ConfigFetcher {
error('You must have at least 1 document set in your config');
}

const branchName = this.getCurrentBranchName();

if (
this.config.version?.branchVersionPrefix &&
branchName.startsWith(this.config.version?.branchVersionPrefix)
this.getCurrentBranchName().startsWith(this.config.version?.branchVersionPrefix)
) {
this.config.version.identifier = this.exctractVersionFromBranch(
branchName,
this.config.version.tag = this.exctractVersionFromBranch(
this.getCurrentBranchName(),
this.config.version?.branchVersionPrefix
);
}
Expand Down
2 changes: 1 addition & 1 deletion cli/src/types/version-config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export interface VersionConfig {
branchVersionPrefix?: string;
identifier?: string;
tag?: string;
}

0 comments on commit 5f33ace

Please sign in to comment.