Skip to content

Commit

Permalink
Fix missing commit and tag messages in dry-run log output.
Browse files Browse the repository at this point in the history
  • Loading branch information
cliffano committed Jul 23, 2023
1 parent 4a2c597 commit d985dae
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 19 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
- Modify syntax for array sub-property following dot-prop 8.x upgrade

### Fixed
- Fix missing commit and tag messages in dry-run log output

## 2.3.0 - 2023-02-18
### Added
- Add text resource type
Expand Down
39 changes: 20 additions & 19 deletions lib/release-schemes/rtk.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,15 @@ class Rtk {
function scmTask(cb) {
const message = util.format('Committing release version changes made to %s...', paths.join(', '));
bag.logStepItemSuccess(message, self.logOpts);
self.scmScheme.saveChanges(util.format('Release version %s', self.versionScheme.getReleaseVersion()), paths, cb);
}

if (!opts.dryRun) {
tasks.push(scmTask);
if (!opts.dryRun) {
self.scmScheme.saveChanges(util.format('Release version %s', self.versionScheme.getReleaseVersion()), paths, cb);
} else {
cb();
}
}
tasks.push(scmTask);

async.series(tasks, cb);

}

release(resources, opts, cb) {
Expand All @@ -85,21 +85,22 @@ class Rtk {

bag.logStepHeading('Executing release step of rtk release scheme...', self.logOpts);

let tasks = [];

function scmTask(cb) {
// Use tagFormat option to format the version to be used as SCM tag
const formattedVersion = stringFormat(opts.tagFormat, { version: self.versionScheme.getReleaseVersion() });
const message = util.format('Adding release version tag %s ...', formattedVersion);
bag.logStepItemSuccess(message, self.logOpts);
self.scmScheme.addVersion(formattedVersion, cb);
}

let tasks = [];
if (!opts.dryRun) {
tasks.push(scmTask);
if (!opts.dryRun) {
self.scmScheme.addVersion(formattedVersion, cb);
} else {
cb();
}
}
tasks.push(scmTask);

async.series(tasks, cb);

}

post(resources, opts, cb) {
Expand All @@ -124,15 +125,15 @@ class Rtk {
function scmTask(cb) {
const message = util.format('Committing next pre-release version changes made to %s...', paths.join(', '));
bag.logStepItemSuccess(message, self.logOpts);
self.scmScheme.saveChanges(util.format('Bump up to next pre-release version %s', self.versionScheme.getPostReleaseVersion()), paths), cb;
}

if (!opts.dryRun) {
tasks.push(scmTask);
if (!opts.dryRun) {
self.scmScheme.saveChanges(util.format('Bump up to next pre-release version %s', self.versionScheme.getPostReleaseVersion()), paths), cb;
} else {
cb();
}
}
tasks.push(scmTask);

async.series(tasks, cb);

}

}
Expand Down

0 comments on commit d985dae

Please sign in to comment.