Ejemplo n.º 1
0
        /// <summary>
        /// CodeCakeBuilder entry point. This is a default, simple, implementation that can
        /// be extended as needed.
        /// </summary>
        /// <param name="args">The command line arguments.</param>
        /// <returns>An error code (typically negative), 0 on success.</returns>
        static async Task <int> Main(string[] args)
        {
            string?solutionDirectory = args.Contains(SolutionDirectoryIsCurrentDirectoryParameter, StringComparer.OrdinalIgnoreCase)
                                        ? Environment.CurrentDirectory
                                        : null;
            var       app    = new CodeCakeApplication(solutionDirectory);
            RunResult result = await app.RunAsync(args.Where(a => !StringComparer.OrdinalIgnoreCase.Equals(a, SolutionDirectoryIsCurrentDirectoryParameter)));

            return(result.ReturnCode);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// CodeCakeBuilder entry point. This is a default, simple, implementation that can
        /// be extended as needed.
        /// </summary>
        /// <param name="args">The command line arguments.</param>
        /// <returns>An error code (typically negative), 0 on success.</returns>
        static async Task <int> Main(string[] args)
        {
            string?solutionDirectory = args.Contains(SolutionDirectoryIsCurrentDirectoryParameter, StringComparer.OrdinalIgnoreCase)
                                        ? Environment.CurrentDirectory
                                        : null;
            var       app    = new CodeCakeApplication(solutionDirectory);
            RunResult result = await app.RunAsync(args.Where(a => !StringComparer.OrdinalIgnoreCase.Equals(a, SolutionDirectoryIsCurrentDirectoryParameter)));

            if (result.InteractiveMode == InteractiveMode.Interactive)
            {
                Console.WriteLine();
                Console.WriteLine($"Hit any key to exit.");
                Console.WriteLine($"Use -{InteractiveAliases.NoInteractionArgument} or -{InteractiveAliases.AutoInteractionArgument} parameter to exit immediately.");
                Console.ReadKey();
            }
            return(result.ReturnCode);
        }