Skip to content

Commit

Permalink
Merge pull request #1 from DmitryAstafyev/master
Browse files Browse the repository at this point in the history
Corrections
  • Loading branch information
DmitryAstafyev authored Oct 17, 2023
2 parents 65dc8d5 + d187921 commit 8b91697
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "envvars"
version = "0.1.5"
version = "0.1.6"
edition = "2021"
authors = ["[email protected]"]
description = "Getting environment variables considering shell configuration"
Expand Down
2 changes: 1 addition & 1 deletion src/extractor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
);
Expand Down
11 changes: 10 additions & 1 deletion src/profiles/unix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,18 @@ pub(crate) fn get() -> Result<Vec<Profile>, 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) {
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}");
Expand Down

0 comments on commit 8b91697

Please sign in to comment.