mirror of
https://github.com/ChrisTitusTech/linutil.git
synced 2024-11-22 13:22:28 +00:00
Compare commits
3 Commits
eb26e92805
...
73891aa260
Author | SHA1 | Date | |
---|---|---|---|
|
73891aa260 | ||
|
696110eae5 | ||
|
a5e24a7148 |
19
.github/release.yml
vendored
19
.github/release.yml
vendored
|
@ -1,20 +1,23 @@
|
||||||
changelog:
|
changelog:
|
||||||
categories:
|
categories:
|
||||||
- title: '🚀 Features'
|
- title: '🚀 Features'
|
||||||
labels:
|
label: 'enhancement'
|
||||||
- 'feature'
|
|
||||||
- 'enhancement'
|
|
||||||
- title: '🐛 Bug Fixes'
|
- title: '🐛 Bug Fixes'
|
||||||
labels:
|
label: 'bug'
|
||||||
- 'fix'
|
- title: '⚙️ Refactoring'
|
||||||
- 'bugfix'
|
label: 'refactor'
|
||||||
- 'bug'
|
- title: '🧩 UI/UX'
|
||||||
|
label: 'UI/UX'
|
||||||
- title: '📚 Documentation'
|
- title: '📚 Documentation'
|
||||||
label: 'documentation'
|
label: 'documentation'
|
||||||
- title: '🔒 Security'
|
- title: '🔒 Security'
|
||||||
label: 'security'
|
label: 'security'
|
||||||
- title: '🧰 GitHub Actions'
|
- title: '🧰 GitHub Actions'
|
||||||
label: 'github actions'
|
label: 'github_actions'
|
||||||
|
- title: '🦀 Rust'
|
||||||
|
label: 'rust'
|
||||||
|
- title: '📃 Scripting'
|
||||||
|
label: 'script'
|
||||||
exclude:
|
exclude:
|
||||||
labels:
|
labels:
|
||||||
- 'skip-changelog'
|
- 'skip-changelog'
|
|
@ -30,6 +30,12 @@ struct Args {
|
||||||
#[arg(default_value_t = Theme::Default)]
|
#[arg(default_value_t = Theme::Default)]
|
||||||
#[arg(help = "Set the theme to use in the application")]
|
#[arg(help = "Set the theme to use in the application")]
|
||||||
theme: Theme,
|
theme: Theme,
|
||||||
|
#[arg(
|
||||||
|
short = 'y',
|
||||||
|
long,
|
||||||
|
help = "Skip confirmation prompt before executing commands"
|
||||||
|
)]
|
||||||
|
skip_confirmation: bool,
|
||||||
#[arg(long, default_value_t = false)]
|
#[arg(long, default_value_t = false)]
|
||||||
#[clap(help = "Show all available options, disregarding compatibility checks (UNSAFE)")]
|
#[clap(help = "Show all available options, disregarding compatibility checks (UNSAFE)")]
|
||||||
override_validation: bool,
|
override_validation: bool,
|
||||||
|
@ -38,7 +44,7 @@ struct Args {
|
||||||
fn main() -> io::Result<()> {
|
fn main() -> io::Result<()> {
|
||||||
let args = Args::parse();
|
let args = Args::parse();
|
||||||
|
|
||||||
let mut state = AppState::new(args.theme, args.override_validation);
|
let mut state = AppState::new(args.theme, args.override_validation, args.skip_confirmation);
|
||||||
|
|
||||||
stdout().execute(EnterAlternateScreen)?;
|
stdout().execute(EnterAlternateScreen)?;
|
||||||
enable_raw_mode()?;
|
enable_raw_mode()?;
|
||||||
|
|
|
@ -62,6 +62,7 @@ pub struct AppState {
|
||||||
drawable: bool,
|
drawable: bool,
|
||||||
#[cfg(feature = "tips")]
|
#[cfg(feature = "tips")]
|
||||||
tip: &'static str,
|
tip: &'static str,
|
||||||
|
skip_confirmation: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub enum Focus {
|
pub enum Focus {
|
||||||
|
@ -79,7 +80,7 @@ pub struct ListEntry {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl AppState {
|
impl AppState {
|
||||||
pub fn new(theme: Theme, override_validation: bool) -> Self {
|
pub fn new(theme: Theme, override_validation: bool, skip_confirmation: bool) -> Self {
|
||||||
let (temp_dir, tabs) = linutil_core::get_tabs(!override_validation);
|
let (temp_dir, tabs) = linutil_core::get_tabs(!override_validation);
|
||||||
let root_id = tabs[0].tree.root().id();
|
let root_id = tabs[0].tree.root().id();
|
||||||
|
|
||||||
|
@ -97,6 +98,7 @@ impl AppState {
|
||||||
drawable: false,
|
drawable: false,
|
||||||
#[cfg(feature = "tips")]
|
#[cfg(feature = "tips")]
|
||||||
tip: get_random_tip(),
|
tip: get_random_tip(),
|
||||||
|
skip_confirmation,
|
||||||
};
|
};
|
||||||
|
|
||||||
state.update_items();
|
state.update_items();
|
||||||
|
@ -681,14 +683,18 @@ impl AppState {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let cmd_names = self
|
if self.skip_confirmation {
|
||||||
.selected_commands
|
self.handle_confirm_command();
|
||||||
.iter()
|
} else {
|
||||||
.map(|node| node.name.as_str())
|
let cmd_names = self
|
||||||
.collect::<Vec<_>>();
|
.selected_commands
|
||||||
|
.iter()
|
||||||
|
.map(|node| node.name.as_str())
|
||||||
|
.collect::<Vec<_>>();
|
||||||
|
|
||||||
let prompt = ConfirmPrompt::new(&cmd_names[..]);
|
let prompt = ConfirmPrompt::new(&cmd_names[..]);
|
||||||
self.focus = Focus::ConfirmationPrompt(Float::new(Box::new(prompt), 40, 40));
|
self.focus = Focus::ConfirmationPrompt(Float::new(Box::new(prompt), 40, 40));
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
self.go_to_selected_dir();
|
self.go_to_selected_dir();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user