public async Task <int> Execute(ExecuteInteractiveCommandOptions options)
        {
            var compiler = new ScriptCompiler(_logFactory, useRestoreCache: false);
            var runner   = new InteractiveRunner(compiler, _logFactory, _scriptConsole, options.PackageSources);

            if (options.ScriptFile == null)
            {
                await runner.RunLoop();
            }
            else
            {
                var context = new ScriptContext(options.ScriptFile.Path.ToSourceText(), Path.GetDirectoryName(options.ScriptFile.Path), options.Arguments, options.ScriptFile.Path, OptimizationLevel.Debug, packageSources: options.PackageSources);
                await runner.RunLoopWithSeed(context);
            }

            return(0);
        }
Пример #2
0
 private static async Task RunInteractive(bool debugMode)
 {
     var compiler = GetScriptCompiler(debugMode);
     var runner   = new InteractiveRunner(compiler, compiler.Logger, ScriptConsole.Default);
     await runner.RunLoop(debugMode);
 }
Пример #3
0
 private static async Task RunInteractive(bool debugMode, bool useRestoreCache, LogFactory logFactory, string[] packageSources)
 {
     var compiler = GetScriptCompiler(debugMode, useRestoreCache, logFactory);
     var runner   = new InteractiveRunner(compiler, logFactory, ScriptConsole.Default, packageSources);
     await runner.RunLoop();
 }
Пример #4
0
 private static async Task RunInteractive(bool debugMode, string[] packageSources)
 {
     var compiler = GetScriptCompiler(debugMode);
     var runner   = new InteractiveRunner(compiler, compiler.Logger, ScriptConsole.Default, packageSources);
     await runner.RunLoop();
 }