mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2026-02-03 03:19:30 +00:00
Code review
This commit is contained in:
@@ -26,6 +26,7 @@ using System;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace ConfigGenerator {
|
||||
@@ -121,6 +122,9 @@ namespace ConfigGenerator {
|
||||
return;
|
||||
}
|
||||
|
||||
// Get rid of any potential whitespaces in bot name
|
||||
input = Regex.Replace(input, @"\s+", "");
|
||||
|
||||
configPage.ASFConfig.Rename(input);
|
||||
configPage.RefreshText();
|
||||
} else if (e.TabPage == NewTab) {
|
||||
@@ -144,6 +148,9 @@ namespace ConfigGenerator {
|
||||
return;
|
||||
}
|
||||
|
||||
// Get rid of any potential whitespaces in bot name
|
||||
input = Regex.Replace(input, @"\s+", "");
|
||||
|
||||
foreach (ASFConfig config in ASFConfig.ASFConfigs) {
|
||||
if (Path.GetFileNameWithoutExtension(config.FilePath).Equals(input)) {
|
||||
Logging.LogGenericError("Bot with such name exists already!");
|
||||
|
||||
Reference in New Issue
Block a user