Skip to content

Commit 7e10ff1

Browse files
committed
conditionally add ~/.local/bin to PATH temporarily
1 parent 048ce58 commit 7e10ff1

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

action.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -428,5 +428,19 @@ runs:
428428
$uv_args = $uv_args | append '-v'
429429
}
430430
431+
let local_bin = '~/.local/bin' | path expand
432+
let tmp_path = if (
433+
('${{ runner.os }}' == 'Linux')
434+
and ($local_bin | path exists)
435+
and (not ($env.PATH | any {$in == $local_bin}))
436+
) {
437+
# add ~/.local/bin to PATH (temporarily)
438+
$env.PATH | append $local_bin
439+
} else {
440+
$env.PATH
441+
}
442+
431443
print $"\n(ansi purple)Running cpp-linter(ansi reset)"
432-
^$'($env.UV_INSTALL_DIR)/uv' ...$uv_args cpp-linter ...$args
444+
with-env {PATH: $tmp_path} {
445+
^$'($env.UV_INSTALL_DIR)/uv' ...$uv_args cpp-linter ...$args
446+
}

0 commit comments

Comments
 (0)