diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f4e47a13..87e9379f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -37,6 +37,12 @@ jobs: - target: aarch64-unknown-linux-gnu os: ubuntu-latest build-tool: cross + - target: x86_64-unknown-linux-musl + os: ubuntu-latest + build-tool: cross + - target: aarch64-unknown-linux-musl + os: ubuntu-latest + build-tool: cross - target: x86_64-pc-windows-msvc os: windows-latest build-tool: cargo diff --git a/Cross.toml b/Cross.toml index 6568d592..77c95de8 100644 --- a/Cross.toml +++ b/Cross.toml @@ -10,3 +10,16 @@ pre-build = [ "apt-get update", "apt-get install -y libudev-dev:$CROSS_DEB_ARCH", ] + +[target.x86_64-unknown-linux-musl] +pre-build = [ + "apt-get update", + "apt-get install -y libudev-dev", +] + +[target.aarch64-unknown-linux-musl] +pre-build = [ + "dpkg --add-architecture $CROSS_DEB_ARCH", + "apt-get update", + "apt-get install -y libudev-dev:$CROSS_DEB_ARCH", +] diff --git a/src/tui/app.rs b/src/tui/app.rs index c1e30a1a..7c19ecbe 100644 --- a/src/tui/app.rs +++ b/src/tui/app.rs @@ -463,12 +463,11 @@ impl App { self.popup = Popup::ConfirmDelete(key.clone()); } } - KeyCode::Char('e') => { + KeyCode::Char('e') // Edit selected secret value - if self.focus == Focus::Secrets { + if self.focus == Focus::Secrets => { self.open_edit_secret(); } - } KeyCode::Char('s') => { // Set/create a new secret self.popup = Popup::SetSecret(SetState { @@ -636,16 +635,12 @@ impl App { self.resolved_values.insert(key.clone(), Some(value)); self.status_message = Some(format!("Updated {} (in memory only)", key)); } - KeyCode::Backspace => { - if state.cursor > 0 { - Self::remove_char_at(&mut state.value, state.cursor - 1); - state.cursor -= 1; - } + KeyCode::Backspace if state.cursor > 0 => { + Self::remove_char_at(&mut state.value, state.cursor - 1); + state.cursor -= 1; } - KeyCode::Delete => { - if state.cursor < state.value.chars().count() { - Self::remove_char_at(&mut state.value, state.cursor); - } + KeyCode::Delete if state.cursor < state.value.chars().count() => { + Self::remove_char_at(&mut state.value, state.cursor); } KeyCode::Left => { state.cursor = state.cursor.saturating_sub(1); @@ -714,15 +709,13 @@ impl App { self.resolved_values.insert(key.clone(), Some(value)); self.status_message = Some(format!("Set {} (in memory only)", key)); } - KeyCode::Backspace => { - if state.cursor > 0 { - let field = match state.field { - SetField::Key => &mut state.key, - SetField::Value => &mut state.value, - }; - Self::remove_char_at(field, state.cursor - 1); - state.cursor -= 1; - } + KeyCode::Backspace if state.cursor > 0 => { + let field = match state.field { + SetField::Key => &mut state.key, + SetField::Value => &mut state.value, + }; + Self::remove_char_at(field, state.cursor - 1); + state.cursor -= 1; } KeyCode::Delete => { let field = match state.field { @@ -768,19 +761,15 @@ impl App { } self.popup = Popup::None; } - KeyCode::Down | KeyCode::Char('j') => { - if !self.available_profiles.is_empty() { - self.profile_picker_index = - (self.profile_picker_index + 1) % self.available_profiles.len(); - } + KeyCode::Down | KeyCode::Char('j') if !self.available_profiles.is_empty() => { + self.profile_picker_index = + (self.profile_picker_index + 1) % self.available_profiles.len(); } - KeyCode::Up | KeyCode::Char('k') => { - if !self.available_profiles.is_empty() { - self.profile_picker_index = self - .profile_picker_index - .checked_sub(1) - .unwrap_or(self.available_profiles.len() - 1); - } + KeyCode::Up | KeyCode::Char('k') if !self.available_profiles.is_empty() => { + self.profile_picker_index = self + .profile_picker_index + .checked_sub(1) + .unwrap_or(self.available_profiles.len() - 1); } _ => {} } diff --git a/src/tui/event.rs b/src/tui/event.rs index 6198804a..78469bb4 100644 --- a/src/tui/event.rs +++ b/src/tui/event.rs @@ -41,22 +41,19 @@ impl EventHandler { if event::poll(tick_rate).unwrap_or(false) { if let Ok(evt) = event::read() { match evt { - CrosstermEvent::Key(key) => { - if tx_clone.send(Event::Key(key)).is_err() { + CrosstermEvent::Key(key) + if tx_clone.send(Event::Key(key)).is_err() => { break; } - } - CrosstermEvent::Mouse(mouse) => { - if tx_clone.send(Event::Mouse(mouse)).is_err() { + CrosstermEvent::Mouse(mouse) + if tx_clone.send(Event::Mouse(mouse)).is_err() => { break; } - } - CrosstermEvent::Resize(_, _) => { + CrosstermEvent::Resize(_, _) // Terminal resize - send tick to trigger redraw - if tx_clone.send(Event::Tick).is_err() { + if tx_clone.send(Event::Tick).is_err() => { break; } - } _ => {} } }