Skip to content

Commit fc05d24

Browse files
committed
[plugin] fix PATH issue
1 parent 6a8a81e commit fc05d24

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

plugin/src/lib.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@ pub fn clippy() -> FnResult<String> {
1515
.with_packages(vec!["curl", "wget"])?
1616
.with_exec(vec!["type rustup > /dev/null || curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh"])?
1717
.with_exec(vec!["rustup", "component", "add", "clippy"])?
18-
.with_exec(vec!["cargo", "install", "clippy-sarif", "--version", "0.3.0"])?
19-
.with_exec(vec!["cargo", "install", "sarif-fmt", "--version", "0.3.0"])?
18+
.with_exec(vec!["PATH=$HOME/.cargo/bin:$PATH", "cargo", "install", "clippy-sarif", "--version", "0.3.0"])?
19+
.with_exec(vec!["PATH=$HOME/.cargo/bin:$PATH","cargo", "install", "sarif-fmt", "--version", "0.3.0"])?
2020
.with_exec(vec![
21+
"PATH=$HOME/.cargo/bin:$PATH",
2122
"cargo",
2223
"clippy",
2324
"--all-features",
@@ -43,6 +44,7 @@ pub fn llvmcov() -> FnResult<String> {
4344
.with_exec(vec!["tar", "xvf", "cargo-llvm-cov-x86_64-unknown-linux-gnu.tar.gz"])?
4445
.with_exec(vec!["mv", "cargo-llvm-cov", "/usr/local/bin"])?
4546
.with_exec(vec![
47+
"PATH=$HOME/.cargo/bin:$PATH",
4648
"cargo",
4749
"llvm-cov",
4850
"--all-features",
@@ -65,7 +67,7 @@ pub fn test(args: String) -> FnResult<String> {
6567
.pkgx()?
6668
.with_packages(vec!["curl", "wget"])?
6769
.with_exec(vec!["type rustup > /dev/null || curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh"])?
68-
.with_exec(vec!["cargo", "test", &args])?
70+
.with_exec(vec!["PATH=$HOME/.cargo/bin:$PATH", "cargo", "test", &args])?
6971
.stdout()?;
7072
Ok(stdout)
7173
}
@@ -79,7 +81,7 @@ pub fn build(args: String) -> FnResult<String> {
7981
.pkgx()?
8082
.with_exec(vec!["pkgx", "install", "curl"])?
8183
.with_exec(vec!["type rustup > /dev/null || curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh"])?
82-
.with_exec(vec!["cargo", "build", &args])?
84+
.with_exec(vec!["PATH=$HOME/.cargo/bin:$PATH", "cargo", "build", &args])?
8385
.stdout()?;
8486
Ok(stdout)
8587
}

0 commit comments

Comments
 (0)