Exemplo n.º 1
0
        public bool Execute(CakeOptions options)
        {
            // Get the script path and the root.
            var path = options.Script.MakeAbsolute(_environment);
            var root = path.GetDirectory();

            // Analyze the script.
            var result = _analyzer.Analyze(path);

            if (!result.Succeeded)
            {
                var messages = string.Join("\n", result.Errors.Select(s => $"{root.GetRelativePath(s.File).FullPath}, line #{s.Line}: {s.Message}"));
                throw new AggregateException($"Bootstrapping failed for '{path}'.\n{messages}");
            }

            // Install modules.
            _processor.InstallModules(
                result.Modules,
                _configuration.GetModulePath(root, _environment));

            // Success.
            return(true);
        }