Skip to content

Commit

Permalink
Log when a glob was not specified
Browse files Browse the repository at this point in the history
  • Loading branch information
justalemon committed Dec 9, 2023
1 parent 2ccd813 commit 49f8bfc
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,19 +62,22 @@ async function run() {
};

for (const [versionType, glob_str] of (Object.entries(patches) as unknown as ([VersionType, string])[])) {
const name = names[versionType];

if (glob_str.length == 0) {
console.log(`Skipping ${name} as no glob was specified`);
continue;
}

const files = await (await glob.create(glob_str)).glob();

if (files.length == 0) {
core.setFailed(`No files found matching glob ${glob_str} for format ${names[versionType]}`);
core.setFailed(`No files found matching glob ${glob_str} for format ${name}`);
}

for (const file of files)
{
console.log(`Patching ${file} as ${names[versionType]}`);
console.log(`Patching ${file} as ${name}`);
await patchFile(file, version, versionType);
}
}
Expand Down

0 comments on commit 49f8bfc

Please sign in to comment.