示例#1
0
        public static async Task <LiteralScript> ProcessLiteralScriptFactory(
            IList <string> scripts,
            IPowershellTranslator translator,
            string scriptName,
            IOptions options)
        {
            var literalScript = new LiteralScript(scripts, translator, scriptName);
            await literalScript.Process(options);

            return(literalScript);
        }
示例#2
0
        public async Task Run(List <IScript> scripts, CancellationToken cancellationToken = default)
        {
            List <string> translatedScripts = new List <string>();

            foreach (IScript script in scripts)
            {
                await script.Process(_options);

                translatedScripts.Add(script.Translator.Translate(script.ScriptFile, _options));
            }

            LiteralScript baseScript = await _literalScriptFactory(translatedScripts, new PowershellTranslator(), "MainScript.ps1", _options);

            string baseScriptTranslator = baseScript.Translator.Translate(baseScript.ScriptFile, _options);

            await _sandboxConfigurationBuilder.Build(baseScriptTranslator);

            await _startProcess(Path.Combine(_options.RootFilesDirectoryLocation, _options.SandboxConfigurationFileName));
        }