added variable replacement to renamer directory

This commit is contained in:
reven
2022-01-31 19:14:33 +13:00
parent 5574f442a3
commit 7244c651dc

View File

@@ -62,13 +62,12 @@
newFile = Regex.Replace(newFile, @"\s(\.[\w\d]+)$", "$1");
newFile = newFile.Replace(" \\", "\\");
string destFolder = DestinationPath;
string destFolder = args.ReplaceVariables(DestinationPath ?? string.Empty, stripMissing: true);
if (string.IsNullOrEmpty(destFolder))
destFolder = new FileInfo(args.WorkingFile).Directory?.FullName ?? "";
var dest = args.GetSafeName(Path.Combine(destFolder, newFile));
args.Logger?.ILog("Renaming file to: " + dest.FullName);
if (string.IsNullOrEmpty(CsvFile) == false)