Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2,322 changes: 1,406 additions & 916 deletions Cargo.lock

Large diffs are not rendered by default.

24 changes: 12 additions & 12 deletions crates/deno_task_shell/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,26 @@ shell = ["futures", "glob", "os_pipe", "path-dedot", "tokio", "tokio-util"]
serialization = ["serde"]

[dependencies]
futures = { version = "0.3.31", optional = true }
glob = { version = "0.3.2", optional = true }
path-dedot = { version = "3.1.1", optional = true }
futures = { version = "0.3.33", optional = true }
glob = { version = "0.3.4", optional = true }
path-dedot = { version = "4.0.1", optional = true }
tokio = { version = "1", features = ["fs", "io-std", "io-util", "macros", "process", "rt-multi-thread", "sync", "time"], optional = true }
tokio-util = { version = "0.7.13", optional = true }
os_pipe = { version = "1.2.1", optional = true }
tokio-util = { version = "0.7.19", optional = true }
os_pipe = { version = "1.2.3", optional = true }
serde = { version = "1", features = ["derive"], optional = true }
thiserror = "2.0.11"
pest = { version="2.7.15", features = ["miette-error"] }
pest_derive = "2.7.15"
thiserror = "2.0.19"
pest = { version="2.8.8", features = ["miette-error"] }
pest_derive = "2.8.8"
dirs = "6.0.0"
pest_ascii_tree = "0.1.0"
miette = { version = "7.5.0", features = ["fancy"] }
miette = { version = "7.6.0", features = ["fancy"] }
lazy_static = "1.5.0"

[target.'cfg(unix)'.dependencies]
libc = "0.2"

[dev-dependencies]
tempfile = "3.16.0"
parking_lot = "0.12.3"
serde_json = "1.0.138"
tempfile = "3.27.0"
parking_lot = "0.12.5"
serde_json = "1.0.151"
pretty_assertions = "1.4.1"
94 changes: 45 additions & 49 deletions crates/deno_task_shell/src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -787,62 +787,58 @@ fn preprocess_heredocs(input: &str) -> String {
'\\' if !in_single_quote => {
j += 1; // skip escaped char
}
'<' if !in_single_quote && !in_double_quote => {
if j + 1 < chars.len() && chars[j + 1] == '<' {
// Found <<
let mut k = j + 2;
// Check for <<- (strip tabs)
let strip_tabs = k < chars.len() && chars[k] == '-';
if strip_tabs {
'<' if !in_single_quote
&& !in_double_quote
&& j + 1 < chars.len()
&& chars[j + 1] == '<' =>
{
// Found <<
let mut k = j + 2;
// Check for <<- (strip tabs)
let strip_tabs = k < chars.len() && chars[k] == '-';
if strip_tabs {
k += 1;
}
// Skip whitespace after << or <<-
while k < chars.len() && chars[k] == ' ' {
k += 1;
}
// Read delimiter (possibly quoted)
let mut delim = String::new();
let mut quoted = false;
if k < chars.len() && (chars[k] == '\'' || chars[k] == '"')
{
quoted = true;
let quote_char = chars[k];
k += 1;
while k < chars.len() && chars[k] != quote_char {
delim.push(chars[k]);
k += 1;
}
// Skip whitespace after << or <<-
while k < chars.len() && chars[k] == ' ' {
k += 1;
if k < chars.len() {
k += 1; // skip closing quote
}
// Read delimiter (possibly quoted)
let mut delim = String::new();
let mut quoted = false;
if k < chars.len()
&& (chars[k] == '\'' || chars[k] == '"')
} else {
while k < chars.len()
&& chars[k] != ' '
&& chars[k] != '\t'
&& chars[k] != '\n'
&& chars[k] != ';'
&& chars[k] != '&'
&& chars[k] != '|'
&& chars[k] != ')'
&& chars[k] != '>'
&& chars[k] != '<'
{
quoted = true;
let quote_char = chars[k];
delim.push(chars[k]);
k += 1;
while k < chars.len() && chars[k] != quote_char {
delim.push(chars[k]);
k += 1;
}
if k < chars.len() {
k += 1; // skip closing quote
}
} else {
while k < chars.len()
&& chars[k] != ' '
&& chars[k] != '\t'
&& chars[k] != '\n'
&& chars[k] != ';'
&& chars[k] != '&'
&& chars[k] != '|'
&& chars[k] != ')'
&& chars[k] != '>'
&& chars[k] != '<'
{
delim.push(chars[k]);
k += 1;
}
}
if !delim.is_empty() {
pending.push((
delim,
quoted,
strip_tabs,
Vec::new(),
));
j = k;
continue;
}
}
if !delim.is_empty() {
pending.push((delim, quoted, strip_tabs, Vec::new()));
j = k;
continue;
}
}
_ => {}
}
Expand Down
35 changes: 18 additions & 17 deletions crates/shell/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,28 +23,29 @@ path = "src/main.rs"
[features]

[dependencies]
clap = { version = "4.5.28", features = ["derive"] }
clap = { version = "4.6.5", features = ["derive"] }
deno_task_shell = { path = "../deno_task_shell", features = ["shell"] }
futures = "0.3.31"
rustyline = { version = "15.0.0", features = ["derive"] }
tokio = "1.43.0"
uu_ls = "0.0.29"
futures = "0.3.33"
rustyline = { version = "18.0.1", features = ["derive"] }
tokio = "1.53.1"
uu_ls = "0.10.0"
dirs = "6.0.0"
which = "7.0.2"
uu_uname = "0.0.29"
uu_touch = "0.0.29"
uu_date = "0.0.29"
miette = { version = "7.5.0", features = ["fancy"] }
filetime = "0.2.25"
chrono = "0.4.39"
parse_datetime = "0.8.0"
which = "8.0.5"
uu_uname = "0.10.0"
uu_touch = "0.10.0"
uu_date = "0.10.0"
miette = { version = "7.6.0", features = ["fancy"] }
filetime = "0.2.29"
chrono = "0.4.45"
jiff = "0.2.35"
parse_datetime = "0.15.0"
dtparse = "2.0.1"
windows-sys = { version = "0.59.0", features = ["Win32_Foundation", "Win32_System_Threading"] }
ctrlc = "3.4.5"
libc = "0.2.170"
windows-sys = { version = "0.61.2", features = ["Win32_Foundation", "Win32_System_Threading"] }
ctrlc = "3.5.2"
libc = "0.2.189"

[dev-dependencies]
tempfile = "3.14.0"
tempfile = "3.27.0"

[package.metadata.release]
# Dont publish the binary
Expand Down
2 changes: 1 addition & 1 deletion crates/shell/src/commands/printenv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ fn execute_printenv(context: &mut ShellCommandContext) -> Result<(), i32> {
if args.is_empty() {
// Print all environment variables
let mut vars: Vec<_> = env_vars.iter().collect();
vars.sort_by(|(a, _), (b, _)| a.cmp(b));
vars.sort_by_key(|(key, _)| *key);

for (key, value) in vars {
context
Expand Down
14 changes: 13 additions & 1 deletion crates/shell/src/commands/touch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ use chrono::{DateTime, Duration, Local, NaiveDateTime, TimeZone, Timelike};
use deno_task_shell::{ExecuteResult, ShellCommand, ShellCommandContext};
use filetime::{set_file_times, set_symlink_file_times, FileTime};
use futures::future::LocalBoxFuture;
use jiff::{tz::TimeZone as JiffTimeZone, Timestamp};
use miette::{miette, IntoDiagnostic, Result};
use uu_touch::{options, uu_app as uu_touch};

Expand Down Expand Up @@ -344,8 +345,19 @@ fn parse_date(ref_time: DateTime<Local>, s: &str) -> Result<FileTime> {
.map_err(|_| miette!("Unable to parse date: {s}"))
} else {
// Use ref_time as a base for relative date parsing
let ref_time = Timestamp::new(
ref_time.timestamp(),
ref_time.timestamp_subsec_nanos() as i32,
)
.map_err(|_| miette!("Unable to parse date: {s}"))?
.to_zoned(JiffTimeZone::system());
parse_datetime::parse_datetime_at_date(ref_time, s)
.map(|dt| datetime_to_filetime(&dt))
.map(|dt| {
FileTime::from_unix_time(
dt.unix_epoch_second(),
dt.subsec_nanosecond() as u32,
)
})
.map_err(|_| miette!("Unable to parse date: {s}"))
}
}
Expand Down
2 changes: 1 addition & 1 deletion crates/shell/src/commands/uname.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ fn display(uname: &UNameOutput) -> String {
.into_iter()
.flatten()
{
output.push_str(name);
output.push_str(&name.to_string_lossy());
output.push(' ');
}
output
Expand Down
10 changes: 5 additions & 5 deletions crates/tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ edition = "2021"
[dependencies]
deno_task_shell = { path = "../deno_task_shell", features = ["shell"] }
shell = { path = "../shell" }
futures = "0.3.31"
tokio = { version = "1.43.0", features = ["full"] }
futures = "0.3.33"
tokio = { version = "1.53.1", features = ["full"] }
dirs = "6.0.0"
miette = "7.5.0"
miette = "7.6.0"

[dev-dependencies]
pretty_assertions = "1.4.1"
regex = "1"
reqwest = { version = "0.12", features = ["blocking"] }
tempfile = "3.16.0"
reqwest = { version = "0.13", features = ["blocking"] }
tempfile = "3.27.0"
Loading