Skip to content

Commit

Permalink
feat Touch (#158)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
prsabahrami authored Sep 29, 2024
1 parent 950da22 commit 89c4910
Show file tree
Hide file tree
Showing 8 changed files with 606 additions and 19 deletions.
72 changes: 68 additions & 4 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 crates/deno_task_shell/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ pest = { git = "https://github.com/pest-parser/pest.git", branch = "master", fea
pest_derive = "2.7.12"
dirs = "5.0.1"
pest_ascii_tree = { git = "https://github.com/prsabahrami/pest_ascii_tree.git", branch = "master" }
miette = "7.2.0"
miette = { version = "7.2.0", features = ["fancy"] }
lazy_static = "1.4.0"

[dev-dependencies]
Expand Down
8 changes: 7 additions & 1 deletion crates/shell/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,15 @@ uu_ls = "0.0.27"
dirs = "5.0.1"
which = "6.0.3"
uu_uname = "0.0.27"
uu_touch = "0.0.27"
uu_date = "0.0.27"
miette = { version = "7.2.0", features = ["fancy"] }
filetime = "0.2.25"
chrono = "0.4.38"
parse_datetime = "0.6.0"
dtparse = "2.0.1"
windows-sys = "0.59.0"
ctrlc = "3.4.5"
miette = { version="7.2.0", features = ["fancy"] }

[package.metadata.release]
# Dont publish the binary
Expand Down
6 changes: 6 additions & 0 deletions crates/shell/src/commands/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@ use uu_ls::uumain as uu_ls;
use crate::execute;

pub mod date;
pub mod touch;
pub mod uname;
pub mod which;

pub use date::DateCommand;
pub use touch::TouchCommand;
pub use uname::UnameCommand;
pub use which::WhichCommand;

Expand Down Expand Up @@ -46,6 +48,10 @@ pub fn get_commands() -> HashMap<String, Rc<dyn ShellCommand>> {
"uname".to_string(),
Rc::new(UnameCommand) as Rc<dyn ShellCommand>,
),
(
"touch".to_string(),
Rc::new(TouchCommand) as Rc<dyn ShellCommand>,
),
(
"date".to_string(),
Rc::new(DateCommand) as Rc<dyn ShellCommand>,
Expand Down
Loading

0 comments on commit 89c4910

Please sign in to comment.