public static void Configure() { string configFile = GetArgument("config", "Please enter the path to the config file to use"); string source = Prompt("Enter the path to the source folder"); string destination = Prompt("Enter the path to the destination folder"); MasucoConfig config = new MasucoConfig(); config.Source = source; config.Destination = destination; config.ToJsonFile(configFile); if (Confirm("Start copying?")) { CopyMatchingSubfolders(); } }
public static void ShowConfiguration() { string configFile = GetArgument("config", "Please enter the path to the config file to use"); if (!File.Exists(configFile)) { Message.PrintLine("Config file {0} not found.", ConsoleColor.Yellow, configFile); Message.PrintLine("Starting configuration...", ConsoleColor.Cyan); Configure(); } else { MasucoConfig config = configFile.SafeReadFile().FromJson <MasucoConfig>(); Message.PrintLine("Source: {0}", ConsoleColor.Cyan, config.Source); Message.PrintLine("Destination: {0}", ConsoleColor.Cyan, config.Destination); } }