Exemple #1
0
        private static void HandleNewCommand(string templateName)
        {
            var config = new LaunchpadConfigProvider().GetConfig();

            var packageName = GetPackageNameOrNull(templateName, config);

            if (packageName == null)
            {
                return;
            }

            using (var tempDirectory = new TemporaryDirectory())
            {
                var packageFetcher    = new PackageFetcher();
                var specProvider      = new LaunchpadSpecProvider();
                var variablesFiller   = new VariableFiller();
                var templateProcessor = new TemplateProcessor();

                packageFetcher.Fetch(packageName, config.NugetSources, tempDirectory.FullPath);

                var templateSpec = specProvider.ProvideFrom(tempDirectory.FullPath);
                var variables    = variablesFiller.FillVariables(templateSpec.Variables);

                templateProcessor.Process(tempDirectory.FullPath, variables);

                specProvider.CleanupIn(tempDirectory.FullPath);

                tempDirectory.CopyContentsTo(Environment.CurrentDirectory);
            }

            Console.Out.WriteLine();
            Console.Out.WriteLine("Done!");
        }
Exemple #2
0
        private static void HandleProcessCommand()
        {
            var specProvider      = new LaunchpadSpecProvider();
            var variablesFiller   = new VariableFiller();
            var templateProcessor = new TemplateProcessor();

            var templateSpec = specProvider.ProvideFrom(Environment.CurrentDirectory);
            var variables    = variablesFiller.FillVariables(templateSpec.Variables);

            templateProcessor.Process(Environment.CurrentDirectory, variables);

            Console.Out.WriteLine();
            Console.Out.WriteLine("Done!");
        }