Skip to content

Commit

Permalink
fix: Add debug messages for exclusions during bump lifecycle (#131)
Browse files Browse the repository at this point in the history
* chore: Add debug messages for exclusions in lifecycle bump

Code has been modified to include debug messages in the bump lifecycle. When a filename is ignored by Git or is not a file, the program will now log a debug-level message.

* chore(#131): Update formatting

* chore(#131): Improve debug messages for exclusions during bump lifecycle
  • Loading branch information
SchulteMarkus committed Apr 19, 2024
1 parent b9dccc2 commit a9191f2
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions lib/lifecycles/bump.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,10 +222,20 @@ function updateConfigs(args, newVersion) {
}
const configPath = path.resolve(process.cwd(), updater.filename);
try {
if (dotgit.ignore(updater.filename)) return;
if (dotgit.ignore(updater.filename)) {
console.debug(
`Not updating file '${updater.filename}', as it is ignored in Git`,
);
return;
}
const stat = fs.lstatSync(configPath);

if (!stat.isFile()) return;
if (!stat.isFile()) {
console.debug(
`Not updating '${updater.filename}', as it is not a file`,
);
return;
}
const contents = fs.readFileSync(configPath, 'utf8');
const newContents = updater.updater.writeVersion(contents, newVersion);
const realNewVersion = updater.updater.readVersion(newContents);
Expand Down

0 comments on commit a9191f2

Please sign in to comment.