Skip to content

Commit

Permalink
fix: version-file-plugin silent skip
Browse files Browse the repository at this point in the history
  • Loading branch information
FRSgit committed Apr 24, 2024
1 parent 959eb62 commit 41e9544
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions packages/release-it-config/version-file-plugin.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,13 @@ class VersionFilePlugin extends Plugin {
super(...args);
this.setContext({ versionFile: path.resolve('./VERSION') });
}
static isEnabled() {
init() {
try {
fs.accessSync(this.getContext('versionFile'));
return true;
} catch {
throw e('Skipping release: VERSION file not present.', false);
}
}
init() {

const data = fs.readFileSync(this.getContext('versionFile'));
const latestVersion = data.toString().trim();
this.setContext({ latestVersion });
Expand Down

0 comments on commit 41e9544

Please sign in to comment.