Skip to content

Commit

Permalink
fix: deno task should actually use current exe for deno command (de…
Browse files Browse the repository at this point in the history
  • Loading branch information
dsherret committed May 23, 2022
1 parent 3c97bbe commit 69be1f3
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ deno_doc = "0.35.0"
deno_graph = "0.27.0"
deno_lint = { version = "0.30.0", features = ["docs"] }
deno_runtime = { version = "0.61.0", path = "../runtime" }
deno_task_shell = "0.3.0"
deno_task_shell = "0.3.1"

atty = "=0.2.14"
base64 = "=0.13.0"
Expand Down
7 changes: 7 additions & 0 deletions cli/tests/integration/task_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,10 @@ itest!(task_additional_args_no_logic {
output: "task/task_additional_args_no_logic.out",
envs: vec![("NO_COLOR".to_string(), "1".to_string())],
});

itest!(task_deno_exe_no_env {
args_vec: vec!["task", "-q", "--config", "task/deno.json", "deno_echo"],
output: "task/task_deno_exe_no_env.out",
envs: vec![("NO_COLOR".to_string(), "1".to_string())],
env_clear: true,
});
1 change: 1 addition & 0 deletions cli/tests/testdata/task/deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"tasks": {
"boolean_logic": "sleep 0.1 && echo 3 && echo 4 & echo 1 && echo 2 || echo NOPE",
"echo": "echo 1",
"deno_echo": "deno eval 'console.log(5)'",
"strings": "deno run main.ts && deno eval \"console.log(\\\"test\\\")\"",
"exit_code_5": "echo $(echo 10 ; exit 2) && exit 5"
}
Expand Down
2 changes: 2 additions & 0 deletions cli/tests/testdata/task/task_deno_exe_no_env.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[WILDCARD]
5
2 changes: 2 additions & 0 deletions cli/tests/testdata/task/task_no_args.out
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
Available tasks:
- boolean_logic
sleep 0.1 && echo 3 && echo 4 & echo 1 && echo 2 || echo NOPE
- deno_echo
deno eval 'console.log(5)'
- echo
echo 1
- exit_code_5
Expand Down
2 changes: 2 additions & 0 deletions cli/tests/testdata/task/task_non_existent.out
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ Task not found: non_existent
Available tasks:
- boolean_logic
sleep 0.1 && echo 3 && echo 4 & echo 1 && echo 2 || echo NOPE
- deno_echo
deno eval 'console.log(5)'
- echo
echo 1
- exit_code_5
Expand Down
4 changes: 4 additions & 0 deletions test_util/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1737,6 +1737,7 @@ pub struct CheckOutputIntegrationTest<'a> {
pub exit_code: i32,
pub http_server: bool,
pub envs: Vec<(String, String)>,
pub env_clear: bool,
}

impl<'a> CheckOutputIntegrationTest<'a> {
Expand Down Expand Up @@ -1766,6 +1767,9 @@ impl<'a> CheckOutputIntegrationTest<'a> {
println!("deno_exe args {}", self.args);
println!("deno_exe testdata path {:?}", &testdata_dir);
command.args(args.iter());
if self.env_clear {
command.env_clear();
}
command.envs(self.envs.clone());
command.current_dir(&testdata_dir);
command.stdin(Stdio::piped());
Expand Down

0 comments on commit 69be1f3

Please sign in to comment.