Skip to content

Commit

Permalink
refactor(docker_context): ignore docker_context on unix domain socket…
Browse files Browse the repository at this point in the history
… path
  • Loading branch information
ananta committed Dec 16, 2023
1 parent df4938a commit ddf38b0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/modules/docker_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ pub fn module<'a>(context: &'a Context) -> Option<Module<'a>> {
}
};

if ctx == "default" {
if ctx == "default" || ctx.starts_with("unix://") {
return None;
}

Expand All @@ -72,7 +72,7 @@ pub fn module<'a>(context: &'a Context) -> Option<Module<'a>> {
_ => None,
})
.map(|variable| match variable {
"context" if !ctx.starts_with("unix://") => Some(Ok(ctx.as_str())),
"context" => Some(Ok(ctx.as_str())),
_ => None,
})
.parse(None, Some(context))
Expand Down Expand Up @@ -304,7 +304,7 @@ mod tests {
only_with_files = false
})
.collect();
let expected = Some(format!("via {} ", Color::Blue.bold().paint("🐳 ")));
let expected = None;

assert_eq!(expected, actual);

Expand Down

0 comments on commit ddf38b0

Please sign in to comment.