Skip to content

Commit

Permalink
Add check if file exists
Browse files Browse the repository at this point in the history
  • Loading branch information
MiguelDomingues committed Jan 11, 2023
1 parent 9075fca commit 3fc1795
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/MarkdownLocalize.CLI/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,13 @@ private void DoDirectory(string input, string output, string poDirectory)
{
string extension = this.Action == ACTION_GENERATE_POT ? ".pot" : ".po";
string poFile = Path.Combine(poDirectory, Path.ChangeExtension(filename, extension));
DoFile(f, outputFile, poFile);
if (File.Exists(poFile))
DoFile(f, outputFile, poFile);
else
{
string relativePath = Path.GetRelativePath(Directory.GetCurrentDirectory(), poFile);
Log("Missing " + relativePath + " file. Skipping...");
}
}
else
DoFile(f, outputFile, this.POTFile);
Expand Down

0 comments on commit 3fc1795

Please sign in to comment.