Esempio n. 1
0
        public void RunGit(dynamic data, string workingDirectory)
        {
            string gitUrl    = data.pull_request.head.repo.git_url;
            string branch    = data.pull_request.head.@ref;
            var    git       = Configuration["GitPath"];
            var    gitResult = new CmdWrapper().RunExecutable(git, $"clone {gitUrl} -b {branch} {workingDirectory}", workingDirectory);

            if (gitResult.ExitCode == -1)
            {
                throw new Exception("GIT clone error.", gitResult.RunException);
            }
        }
Esempio n. 2
0
        public bool RunAnalysis(string workingDirectory)
        {
            var cliResult = new CmdWrapper().RunExecutable("/bin/bash", "-c \"jshint " + workingDirectory + "\"", workingDirectory);

            if (cliResult.ExitCode == -1)
            {
                throw new Exception("CLI analysis error.", cliResult.RunException);
            }

            var output = cliResult.Output.ToString();

            return(!string.IsNullOrEmpty(output.Trim()));
        }