aboutsummaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
Diffstat (limited to 'source')
-rw-r--r--source/app.d1
-rw-r--r--source/conda.d13
2 files changed, 11 insertions, 3 deletions
diff --git a/source/app.d b/source/app.d
index 8eb3625..4cc2288 100644
--- a/source/app.d
+++ b/source/app.d
@@ -98,6 +98,7 @@ int main(string[] args) {
conda.dump_env_yaml(buildPath(output_dir, env_name ~ ".yml"));
conda.dump_env_explicit(buildPath(output_dir, env_name ~ ".txt"));
+ writeln("Output directory is: " ~ output_dir);
writeln("Done!");
return 0;
}
diff --git a/source/conda.d b/source/conda.d
index 3f1fe1c..e2e1782 100644
--- a/source/conda.d
+++ b/source/conda.d
@@ -12,11 +12,18 @@ import std.typecons;
static auto getenv(string[string] base=null, string preface=null) {
const char delim = '=';
+ char delim_line = '\n';
string[string] env;
string cmd = "env";
- version (Linux) {
- cmd = cmd ~ " -0";
+ version (linux) {
+ cmd ~= " -0";
+ delim_line = '\0';
+ }
+
+ version (Windows) {
+ cmd = "set";
+ delim_line = "\r\n";
}
// Execute a command before dumping the environment
@@ -31,7 +38,7 @@ static auto getenv(string[string] base=null, string preface=null) {
throw new Exception("Unable to read shell environment");
}
- foreach (string line; split(env_sh.output, '\0')) {
+ foreach (string line; split(env_sh.output, delim_line)) {
if (line.empty) {
continue;
}