Skip to content

Commit 9137e1b

Browse files
authored
fix: Audit 08/07 (#2077)
* Bump. * Fix env vars. * Fix args. * Update.
1 parent c84a9a2 commit 9137e1b

5 files changed

Lines changed: 33 additions & 33 deletions

File tree

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Changelog
22

3+
## Unreleased
4+
5+
#### 🐞 Fixes
6+
7+
- Fixed an issue with `moon setup` failing when proto is not available.
8+
- Fixed task input inferrence to not include the `$HOME`, `$USER`, and `$PWD` environment variables.
9+
- Fixed some arg/shell quoting issues.
10+
311
## 1.39.3
412

513
#### 🐞 Fixes

Cargo.lock

Lines changed: 16 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ starbase_archive = { version = "0.11.3", default-features = false, features = [
7373
starbase_console = { version = "0.6.13", features = ["miette"] }
7474
starbase_events = "0.7.3"
7575
starbase_sandbox = "0.9.4"
76-
starbase_shell = "0.9.1"
76+
starbase_shell = "0.10.1"
7777
starbase_styles = { version = "0.6.1", features = ["relative-path"] }
7878
starbase_utils = { version = "0.11.13", default-features = false, features = [
7979
"editor-config",

crates/process/src/shell.rs

Lines changed: 5 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
use cached::proc_macro::cached;
2-
use moon_args::join_args_os;
3-
use starbase_shell::BoxedShell;
2+
use starbase_shell::{BoxedShell, join_args};
43
use std::ffi::{OsStr, OsString};
54
use std::path::PathBuf;
65

@@ -51,34 +50,11 @@ impl Shell {
5150
}
5251
}
5352

54-
pub fn is_quoted(&self, arg: &str) -> bool {
55-
arg.starts_with("$'") || arg.starts_with("'") || arg.starts_with('"')
56-
}
57-
5853
pub fn join_args(&self, args: Vec<OsString>) -> OsString {
59-
let mut line = OsString::new();
60-
let last_index = args.len() - 1;
61-
62-
for (index, arg) in args.into_iter().enumerate() {
63-
let quoted_arg = match arg.to_str() {
64-
Some(inner) => {
65-
if self.is_quoted(inner) {
66-
arg
67-
} else {
68-
OsString::from(self.instance.quote(inner))
69-
}
70-
}
71-
None => join_args_os([arg]),
72-
};
73-
74-
line.push(&quoted_arg);
75-
76-
if index != last_index {
77-
line.push(OsStr::new(" "));
78-
}
79-
}
80-
81-
line
54+
OsString::from(join_args(
55+
&self.instance,
56+
args.iter().filter_map(|arg| arg.to_str()),
57+
))
8258
}
8359
}
8460

crates/task-expander/src/token_expander.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -765,6 +765,9 @@ impl<'graph> TokenExpander<'graph> {
765765

766766
fn infer_inputs_from_set(&self, task: &mut Task, mut set: FxHashSet<String>) {
767767
let mut blacklist = vec![
768+
"HOME",
769+
"USER",
770+
"PWD",
768771
"CI_",
769772
"GIT_",
770773
"BUILD_",

0 commit comments

Comments
 (0)