Exemplo n.º 1
0
        public virtual ScriptResult Execute(string script, params string[] scriptArgs)
        {
            var path   = Path.IsPathRooted(script) ? script : Path.Combine(FileSystem.CurrentDirectory, script);
            var result = FilePreProcessor.ProcessFile(path);

            ScriptEngine.FileName = Path.GetFileName(path);
            return(EngineExecute(Path.GetDirectoryName(path), scriptArgs, result));
        }
Exemplo n.º 2
0
        protected internal virtual FilePreProcessorResult LoadScriptLibraries(string workingDirectory)
        {
            if (string.IsNullOrWhiteSpace(ScriptLibraryComposer.ScriptLibrariesFile))
            {
                return(null);
            }

            var scriptLibrariesPath = Path.Combine(workingDirectory, FileSystem.PackagesFolder,
                                                   ScriptLibraryComposer.ScriptLibrariesFile);

            if (FileSystem.FileExists(scriptLibrariesPath))
            {
                _log.DebugFormat("Found Script Library at {0}", scriptLibrariesPath);
                return(FilePreProcessor.ProcessFile(scriptLibrariesPath));
            }

            return(null);
        }