Skip to content

Commit 89c4910

Browse files
authored
feat Touch (#158)
* Add support for test * Added tests * run fmt * Moved touch stuff to shell side * Redo testing by moving functions on touch.rs to shell * Increase coverage * run fmt * Remove extra crates * Add support for windows * Update lockfile * Fix error message * Update test * Using TEMPDIR for absolute path instead of ~ * run fmt * Using OpenOptions instead of File for file creation * run fmt * map error to print the same error on both platforms * Updated tests * Add tmate for debugging * Update tmate github action * Add temp_dir correctly to test_builder * Use NO_GRAPHICS for miette erros * Remove extra print in assert * Update duplicate in toml file
1 parent 950da22 commit 89c4910

File tree

8 files changed

+606
-19
lines changed

8 files changed

+606
-19
lines changed

Cargo.lock

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

crates/deno_task_shell/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ pest = { git = "https://github.com/pest-parser/pest.git", branch = "master", fea
2727
pest_derive = "2.7.12"
2828
dirs = "5.0.1"
2929
pest_ascii_tree = { git = "https://github.com/prsabahrami/pest_ascii_tree.git", branch = "master" }
30-
miette = "7.2.0"
30+
miette = { version = "7.2.0", features = ["fancy"] }
3131
lazy_static = "1.4.0"
3232

3333
[dev-dependencies]

crates/shell/Cargo.toml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,15 @@ uu_ls = "0.0.27"
3232
dirs = "5.0.1"
3333
which = "6.0.3"
3434
uu_uname = "0.0.27"
35+
uu_touch = "0.0.27"
3536
uu_date = "0.0.27"
37+
miette = { version = "7.2.0", features = ["fancy"] }
38+
filetime = "0.2.25"
39+
chrono = "0.4.38"
40+
parse_datetime = "0.6.0"
41+
dtparse = "2.0.1"
42+
windows-sys = "0.59.0"
3643
ctrlc = "3.4.5"
37-
miette = { version="7.2.0", features = ["fancy"] }
3844

3945
[package.metadata.release]
4046
# Dont publish the binary

crates/shell/src/commands/mod.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,12 @@ use uu_ls::uumain as uu_ls;
88
use crate::execute;
99

1010
pub mod date;
11+
pub mod touch;
1112
pub mod uname;
1213
pub mod which;
1314

1415
pub use date::DateCommand;
16+
pub use touch::TouchCommand;
1517
pub use uname::UnameCommand;
1618
pub use which::WhichCommand;
1719

@@ -46,6 +48,10 @@ pub fn get_commands() -> HashMap<String, Rc<dyn ShellCommand>> {
4648
"uname".to_string(),
4749
Rc::new(UnameCommand) as Rc<dyn ShellCommand>,
4850
),
51+
(
52+
"touch".to_string(),
53+
Rc::new(TouchCommand) as Rc<dyn ShellCommand>,
54+
),
4955
(
5056
"date".to_string(),
5157
Rc::new(DateCommand) as Rc<dyn ShellCommand>,

0 commit comments

Comments
 (0)