Ejemplo n.º 1
0
        static void Main(string[] args)
        {
#if DEBUG
            args = new string[] { "TestList.yaml" };
#endif
            if (args.Length > 0 && args.Length <= 2 && File.Exists(args[0]))
            {
                if (args.Length > 1 && Directory.Exists(args[1]))
                {
                    RootDirectory = args[1];
                }
                else
                {
                    RootDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
                }
                //Get the directory creation 'instructions'
                KeyValuePair <DirInfo[], int> instructions = Parser.ParseDirectoryInstructions(args[0]);

                //Create the directories based on the 'instructions'
                DirectoryCreator.CreateDirectories(instructions.Key);

                //Print a pretty tree of what directories were made in which order.
                Output.PrintTree(instructions.Key[0]);

                Console.WriteLine();
                Console.WriteLine("Press Any Key to Exit...");
                Console.ReadKey();
            }
            else
            {
                Console.WriteLine("Usage: {0} [InputFile] (rootDirectory)", (System.Reflection.Assembly.GetExecutingAssembly().GetName().Name + ".exe"));
                Console.WriteLine("Or you can just drag a valid input file onto the executable");
                System.Threading.Thread.Sleep(2500);
                return;
            }
        }