From 2b2124ce03290e5866a3554a9d292f1cb4650710 Mon Sep 17 00:00:00 2001 From: DmitryAstafyev Date: Tue, 17 Oct 2023 15:03:08 +0200 Subject: [PATCH 1/4] Ignore comments in /etc/shells --- src/profiles/unix.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/profiles/unix.rs b/src/profiles/unix.rs index 8bfef0f..6f28e74 100644 --- a/src/profiles/unix.rs +++ b/src/profiles/unix.rs @@ -12,6 +12,7 @@ pub(crate) fn get() -> Result, Error> { for shell in read_to_string(shells_file_path) .map_err(Error::Io)? .split('\n') + .filter(|s| !s.starts_with('#') && !s.is_empty()) { let path = Path::new(shell); let profile = match Profile::new(&path.to_path_buf(), vec!["-c"], None) { From 3f9d7741766f7b50fb43eaf90949e6b7850eee84 Mon Sep 17 00:00:00 2001 From: DmitryAstafyev Date: Tue, 17 Oct 2023 15:06:23 +0200 Subject: [PATCH 2/4] Remove extra logs --- src/extractor.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/extractor.rs b/src/extractor.rs index 5f29420..a75bb11 100644 --- a/src/extractor.rs +++ b/src/extractor.rs @@ -60,7 +60,7 @@ impl Extractor { fn delivery(&mut self) -> Result<(), io::Error> { if self.location.exists() { - log::warn!( + log::info!( "Extractor {:?} already exists. Checking checksum.", self.location ); From af90b8988b87148bb7728fbc8d54476c3a6db23f Mon Sep 17 00:00:00 2001 From: DmitryAstafyev Date: Tue, 17 Oct 2023 20:20:38 +0200 Subject: [PATCH 3/4] Update unix args for shell executing --- src/profiles/unix.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/profiles/unix.rs b/src/profiles/unix.rs index 6f28e74..ea3e269 100644 --- a/src/profiles/unix.rs +++ b/src/profiles/unix.rs @@ -15,7 +15,15 @@ pub(crate) fn get() -> Result, Error> { .filter(|s| !s.starts_with('#') && !s.is_empty()) { let path = Path::new(shell); - let profile = match Profile::new(&path.to_path_buf(), vec!["-c"], None) { + let profile = match Profile::new( + &path.to_path_buf(), + if path.ends_with("tcsh") || path.ends_with("csh") { + vec!["-ic"] + } else { + vec!["-i", "-l", "-c"] + }, + None, + ) { Ok(profile) => profile, Err(err) => { log::warn!("Cannot get envvars for {shell}: {err}"); From d187921df5007476039f34bd4e32f9d3db0d2bed Mon Sep 17 00:00:00 2001 From: DmitryAstafyev Date: Tue, 17 Oct 2023 20:35:46 +0200 Subject: [PATCH 4/4] Version up to 0.1.6 --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 7812ba6..068c13b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "envvars" -version = "0.1.5" +version = "0.1.6" edition = "2021" authors = ["d.astafyev@outlook.com"] description = "Getting environment variables considering shell configuration"