Example #1
0
        public override void Execute()
        {
            Console2.YellowLine("Host:");
            Console2.Line(_hostEnvironment.ToYml());

            Console2.YellowLine("Database:");
            Console2.Line(_dbOptions.ToYml());
        }
Example #2
0
        private void ExecuteShell(string command, string workingDir = null)
        {
            Console2.BreakLine();
            Console2.YellowLine($"Executing '{command}' at {workingDir.Or("Current directory")}");
            Console2.BreakLine();

            int ret = OS.ShellToConsole(command, workingDir);

            if (ret != 0)
            {
                Console2.RedLine($"Shell command returned code {ret}. Something went wrong. It should return 0");
                throw new Exception($"Shell command returned code {ret}");
            }
        }
Example #3
0
        private void ShowDir(Func <MiruSolution, string> func)
        {
            var solutionFinder = new SolutionFinder(new FileSystem());

            var result = solutionFinder.FromDir(Directory.GetCurrentDirectory());

            if (result.FoundSolution)
            {
                Console.WriteLine(func(result.Solution));
            }
            else
            {
                Console2.YellowLine($"{Directory.GetCurrentDirectory()} is not part of a Miru Solution structure");
            }
        }
Example #4
0
        public override bool Execute(Input input)
        {
            Console2.Yellow("App version: ");
            Console2.Line($"{Assembly.GetEntryAssembly().GetName().Name} {Assembly.GetEntryAssembly().GetName().Version}");

            Console2.Yellow("Miru version: ");
            Console2.Line(typeof(App).Assembly.GetName().Version?.ToString());
            Console.WriteLine();

            Console2.YellowLine("Host:");
            Console2.Line(_hostEnvironment.ToYml());

            Console2.YellowLine("All Configurations: ");
            Console.WriteLine(GetDebugView(_configuration as IConfigurationRoot));

            return(true);
        }
Example #5
0
        public override bool Execute(Input input)
        {
            var make = new Maker(_solution);

            Console2.BreakLine();

            if (input.Template.IsEmpty())
            {
                Console2.YellowLine("Choose one of the templates passing the flag:");
                Console2.WhiteLine("--new");
                Console2.WhiteLine("--show");
                Console2.WhiteLine("--list");
                Console2.WhiteLine("--edit");

                return(false);
            }

            make.Feature(input.In, input.Name, input.Action, input.Template);

            Console2.BreakLine();

            return(true);
        }