Skip to content

Commit 559c4e3

Browse files
committed
Replace which with type builtin: #42
1 parent dc49077 commit 559c4e3

File tree

7 files changed

+8
-8
lines changed

7 files changed

+8
-8
lines changed

src/package/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ mod tests {
137137
let agent_mock = thread::spawn(move || {
138138
let req = ZMsg::recv(&mut server).unwrap();
139139
assert_eq!("command::exec", req.popstr().unwrap().unwrap());
140-
assert_eq!("which brew", req.popstr().unwrap().unwrap());
140+
assert_eq!("type brew", req.popstr().unwrap().unwrap());
141141

142142
let rep = ZMsg::new();
143143
rep.addstr("Ok").unwrap();
@@ -195,7 +195,7 @@ mod tests {
195195

196196
let req = ZMsg::recv(&mut server).unwrap();
197197
assert_eq!("command::exec", req.popstr().unwrap().unwrap());
198-
assert_eq!("which brew", req.popstr().unwrap().unwrap());
198+
assert_eq!("type brew", req.popstr().unwrap().unwrap());
199199

200200
let rep = ZMsg::new();
201201
rep.addstr("Ok").unwrap();

src/package/providers/apt.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ impl Provider for Apt {
2121
}
2222

2323
fn is_active(&self, host: &mut Host) -> Result<bool> {
24-
let cmd = Command::new("which apt-get");
24+
let cmd = Command::new("type apt-get");
2525
let result = try!(cmd.exec(host));
2626

2727
Ok(result.exit_code == 0)

src/package/providers/dnf.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ impl Provider for Dnf {
2222
}
2323

2424
fn is_active(&self, host: &mut Host) -> Result<bool> {
25-
let cmd = Command::new("which dnf");
25+
let cmd = Command::new("type dnf");
2626
let result = try!(cmd.exec(host));
2727

2828
Ok(result.exit_code == 0)

src/package/providers/homebrew.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ impl Provider for Homebrew {
2222
}
2323

2424
fn is_active(&self, host: &mut Host) -> Result<bool> {
25-
let cmd = Command::new("which brew");
25+
let cmd = Command::new("type brew");
2626
let result = try!(cmd.exec(host));
2727

2828
Ok(result.exit_code == 0)

src/package/providers/nix.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ impl Provider for Nix {
2121
}
2222

2323
fn is_active(&self, host: &mut Host) -> Result<bool> {
24-
let cmd = Command::new("which nix-env");
24+
let cmd = Command::new("type nix-env");
2525
let result = try!(cmd.exec(host));
2626

2727
Ok(result.exit_code == 0)

src/package/providers/pkg.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ impl Provider for Pkg {
2121
}
2222

2323
fn is_active(&self, host: &mut Host) -> Result<bool> {
24-
let cmd = Command::new("which pkg");
24+
let cmd = Command::new("type pkg");
2525
let result = try!(cmd.exec(host));
2626

2727
Ok(result.exit_code == 0)

src/package/providers/yum.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ impl Provider for Yum {
2222
}
2323

2424
fn is_active(&self, host: &mut Host) -> Result<bool> {
25-
let cmd = Command::new("which yum");
25+
let cmd = Command::new("type yum");
2626
let result = try!(cmd.exec(host));
2727

2828
Ok(result.exit_code == 0)

0 commit comments

Comments
 (0)