Beispiel #1
0
        private void SetSlug()
        {
            QueryParameters["slug"] = string.Empty;

            foreach (var repository in Repositories)
            {
                if (!string.IsNullOrWhiteSpace(repository.Slug))
                {
                    QueryParameters["slug"] = WebUtility.UrlEncode(repository.Slug);
                    break;
                }
            }

            var slugEnv = _environmentVariables.GetEnvironmentVariable("CODECOV_SLUG");

            if (!string.IsNullOrWhiteSpace(slugEnv))
            {
                QueryParameters["slug"] = WebUtility.UrlEncode(slugEnv.Trim());
            }

            if (!string.IsNullOrWhiteSpace(Options.Slug))
            {
                QueryParameters["slug"] = WebUtility.UrlEncode(Options.Slug.Trim());
            }
        }
Beispiel #2
0
        public string GetEnvironmentVariable(string name)
        {
            var env = _environmentVariables.GetEnvironmentVariable(name);

            if (string.IsNullOrEmpty(env))
            {
                return(string.Empty);
            }

            return(env);
        }
Beispiel #3
0
        private string LoadHost()
        {
            // Try to get from commandline
            if (!string.IsNullOrWhiteSpace(Options.Url))
            {
                return(Options.Url.Trim().TrimEnd('/'));
            }

            // Try to get it from enviornment variable else just use default url.
            var urlEnv = _environmentVariables.GetEnvironmentVariable("CODECOV_URL");

            return(!string.IsNullOrWhiteSpace(urlEnv) ? urlEnv.Trim().TrimEnd('/') : "https://codecov.io");
        }