Skip to content

Commit

Permalink
Save bash scripts with unix line endings, so that cygwin doesn't get …
Browse files Browse the repository at this point in the history
…confused.
  • Loading branch information
QAston committed Aug 15, 2016
1 parent c9567f2 commit c73e041
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,14 +153,14 @@ fn generate_mod_env(name: &str, value: &str, m: ModType, e: EnvType) -> String {
match e {
EnvType::CMD => format!("set {}={}\r\n", name, &mod_env_val),
EnvType::POWERSHELL => format!("$env:{}=\"{}\"\r\n", name, &mod_env_val),
EnvType::BASH => format!("export {}={}\r\n", name, &mod_env_val),
EnvType::BASH => format!("export {}={}\n", name, &mod_env_val),
}
}

fn generate_src_env(file_to_src: &Path, e: EnvType) -> String {
match e {
EnvType::CMD => format!("call %~dp0\\{}\r\n", file_to_src.display()),
EnvType::BASH => format!("source {}\r\n", file_to_src.display()),
EnvType::BASH => format!("source {}\n", file_to_src.display()),
EnvType::POWERSHELL => format!(". {}\r\n", file_to_src.display()),
}
}
Expand Down

0 comments on commit c73e041

Please sign in to comment.