Пример #1
0
        static int Main(string[] args)
        {
            WriteHeader();
            if (args.Length == 0)
            {
                "Usage: makesharp script_name [task_name] [arg0] [arg1] [...]".ToConsole();
                return(0);
            }

            var file = args[0];

            if (!File.Exists(file))
            {
                "File '{0}' couldn't be found".WriteError(file);
                return(1);
            }


            Configure(args);

            var host   = new ScriptCsHost();
            var result = host.Execute(file);

            if (result.CompileExceptionInfo != null)
            {
                Console.WriteLine(result.CompileExceptionInfo.SourceException);
            }
            if (result.ExecuteExceptionInfo != null)
            {
                Console.WriteLine(result.ExecuteExceptionInfo.SourceException);
            }

            // Console.ReadKey();
            return(0);
        }
Пример #2
0
        static int Main(string[] args)
        {
            WriteHeader();
            if (args.Length == 0)
            {
                "Usage: makesharp script_name [task_name] [arg0=value] [arg1=value] [...]".ToConsole();
                return 0;
            }

            var file = args[0];
            if (!File.Exists(file))
            {
                "File '{0}' couldn't be found".WriteError(file);
                return 1;
            }

          
            Configure(args);

            var host = new ScriptCsHost();
            var result = host.Execute(file);
            if (result.CompileExceptionInfo != null) Console.WriteLine(result.CompileExceptionInfo.SourceException);
            if (result.ExecuteExceptionInfo != null) Console.WriteLine(result.ExecuteExceptionInfo.SourceException);
//#if DEBUG
       // Console.ReadKey();
//#endif

            return 0;
        }