Esempio n. 1
0
        public static void New(this Maker m, string name)
        {
            var newSolutionDir = A.Path(m.Solution.RootDir, name);

            ThrowIfNewDirectoryExist(newSolutionDir);

            Console.WriteLine();

            // root
            m.Directory();
            Console.WriteLine();

            var map = Maker.ReadEmbedded("_New.yml").FromYml <Dictionary <string, string> >();

            foreach (var(key, stub) in map)
            {
                // FIXME: Use same tokens replacement as m.Template
                var destination = key
                                  .Replace("Corpo.Skeleton", m.Solution.Name)
                                  .Replace("Skeleton", m.Solution.ShortName)
                                  .Replace('\\', Path.DirectorySeparatorChar);

                m.Template(stub, destination);
            }

            m.Template("appSettings-example.yml", A.Path("src") / name / "appSettings.Development.yml");
            m.Template("appSettings-example.yml", A.Path("src") / name / "appSettings.Test.yml");

            Console2.BreakLine();
            Console2.Line($"New solution created at:");
            Console2.BreakLine();
            Console2.GreenLine($"\t{m.Solution.RootDir}");
            Console2.BreakLine();
            Console2.GreenLine("Good luck!");
        }
Esempio n. 2
0
        public static void New(this Maker m, string name)
        {
            var newSolutionDir = A.Path(m.Solution.RootDir, name);

            ThrowIfNewDirectoryExist(newSolutionDir);

            Console.WriteLine();

            // root
            m.Directory();
            Console.WriteLine();

            var map = Maker.ReadEmbedded("_New.yml").FromYml <Dictionary <string, string> >();

            foreach (var(key, stub) in map)
            {
                var destination = key
                                  .Replace("Skeleton", name)
                                  .Replace('\\', Path.DirectorySeparatorChar);

                m.Template(stub, destination);
            }

            Console2.BreakLine();
            Console2.Line($"New solution created at:");
            Console2.BreakLine();
            Console2.GreenLine($"\t{m.Solution.RootDir}");
            Console2.BreakLine();
            Console2.GreenLine("Good luck!");
        }