diff --git a/Cargo.lock b/Cargo.lock index ccf08ab..92bd9f0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -63,7 +63,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "awscredx" -version = "0.5.2" +version = "0.5.3" dependencies = [ "ansi_term 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)", "chrono 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", diff --git a/Cargo.toml b/Cargo.toml index 9bec5d2..8022893 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "awscredx" -version = "0.5.2" +version = "0.5.3" authors = ["Alexei Samokvalov "] edition = "2018" diff --git a/src/init/mod.rs b/src/init/mod.rs index 8c2b204..579db09 100644 --- a/src/init/mod.rs +++ b/src/init/mod.rs @@ -124,7 +124,7 @@ fn write_shell_script(ctx: &JobContext) -> Result { let title = format!("Create shell script '{}'", ctx.styles.path.paint(ctx.shell_config_script.to_str().unwrap())); - if outdated_script() { + if !ctx.shell_config_script.exists() || outdated_script() { let file = File::create(&ctx.shell_config_script) .map_err(|e| format!("cannot create configuration file {}: {}", ctx.shell_config_script.display(), e))?; util::set_permissions(&ctx.shell_config_script, 0o600);