internal async static Task <CondaInfoResult> ExecuteCondaInfoAsync(string condaPath)
        {
            var activationVars = await CondaUtils.GetActivationEnvironmentVariablesForRootAsync(condaPath);

            var envVars = activationVars.Union(UnbufferedEnv).ToArray();

            var args = new[] { "info", "--json" };

            using (var output = ProcessOutput.Run(condaPath, args, null, envVars, false, null)) {
                output.Wait();
                if (output.ExitCode == 0)
                {
                    var json = string.Join(Environment.NewLine, output.StandardOutputLines);
                    try {
                        return(JsonConvert.DeserializeObject <CondaInfoResult>(json));
                    } catch (JsonException ex) {
                        Debug.WriteLine("Failed to parse: {0}".FormatInvariant(ex.Message));
                        Debug.WriteLine(json);
                        return(null);
                    }
                }
                return(null);
            }
        }
Beispiel #2
0
        private async Task <KeyValuePair <string, string>[]> GetEnvironmentVariables()
        {
            var activationVars = await CondaUtils.GetActivationEnvironmentVariablesForRootAsync(_condaPath);

            return(activationVars.Union(UnbufferedEnv).ToArray());
        }