mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2026-04-10 05:12:21 +00:00
Generate file name if given output path CLI argument is a directory
Closes #67
This commit is contained in:
@@ -38,9 +38,9 @@ namespace DiscordChatExporter.Cli.Verbs
|
||||
|
||||
// Generate file path if not set
|
||||
var filePath = Options.FilePath;
|
||||
if (filePath.IsBlank())
|
||||
if (filePath == null || filePath.EndsWith("/") || filePath.EndsWith("\\"))
|
||||
{
|
||||
filePath = $"{guild.Name} - {channel.Name}.{Options.ExportFormat.GetFileExtension()}"
|
||||
filePath += $"{guild.Name} - {channel.Name}.{Options.ExportFormat.GetFileExtension()}"
|
||||
.Replace(Path.GetInvalidFileNameChars(), '_');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user