-
Notifications
You must be signed in to change notification settings - Fork 226
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #274 from lj3954/restructure_linutil
refactor: Split linutil into TUI and Core crates
- Loading branch information
Showing
56 changed files
with
167 additions
and
139 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
[package] | ||
name = "linutil_core" | ||
edition = "2021" | ||
version.workspace = true | ||
license.workspace = true | ||
|
||
[dependencies] | ||
include_dir = "0.7.4" | ||
tempdir = "0.3.7" | ||
serde = { version = "1.0.205", features = ["derive"] } | ||
toml = "0.8.19" | ||
which = "6.0.3" | ||
ego-tree = { workspace = true } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
mod inner; | ||
|
||
use ego_tree::Tree; | ||
use std::path::PathBuf; | ||
|
||
pub use inner::get_tabs; | ||
|
||
#[derive(Clone, Hash, Eq, PartialEq)] | ||
pub enum Command { | ||
Raw(String), | ||
LocalFile(PathBuf), | ||
None, // Directory | ||
} | ||
|
||
#[derive(Clone, Hash, Eq, PartialEq)] | ||
pub struct Tab { | ||
pub name: String, | ||
pub tree: Tree<ListNode>, | ||
} | ||
|
||
#[derive(Clone, Hash, Eq, PartialEq)] | ||
pub struct ListNode { | ||
pub name: String, | ||
pub command: Command, | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
[package] | ||
name = "linutil_tui" | ||
edition = "2021" | ||
version.workspace = true | ||
license.workspace = true | ||
|
||
[dependencies] | ||
clap = { version = "4.5.16", features = ["derive"] } | ||
crossterm = "0.28.1" | ||
ego-tree = { workspace = true } | ||
oneshot = "0.1.8" | ||
portable-pty = "0.8.1" | ||
ratatui = "0.28.1" | ||
tui-term = "0.1.12" | ||
unicode-width = "0.1.13" | ||
linutil_core = { path = "../core" } | ||
|
||
[build-dependencies] | ||
chrono = "0.4.33" | ||
|
||
[[bin]] | ||
name = "linutil" | ||
path = "src/main.rs" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
fn main() { | ||
// Add current date as a variable to be displayed in the 'Linux Toolbox' text. | ||
println!( | ||
"cargo:rustc-env=BUILD_DATE={}", | ||
chrono::Local::now().format("%Y-%m-%d") | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Oops, something went wrong.