diff --git a/scripts/install_ubuntu_dependencies.sh b/scripts/install_ubuntu_dependencies.sh index 7c81fb6f5..5d76cb769 100755 --- a/scripts/install_ubuntu_dependencies.sh +++ b/scripts/install_ubuntu_dependencies.sh @@ -19,6 +19,10 @@ ${SUDOCMD} apt-get install -y \ git \ build-essential \ +if [ -z "${PACKAGING}" ]; then + PACKAGING=0 +fi + if [ "${PACKAGING}" -eq 1 ]; then ${SUDOCMD} apt-get install -y \ devscripts \ diff --git a/tools/cli/build.rs b/tools/cli/build.rs index 51e971860..0f8197eed 100644 --- a/tools/cli/build.rs +++ b/tools/cli/build.rs @@ -1,6 +1,7 @@ #![allow(dead_code)] use std::env; +use std::io::Error; use std::path::PathBuf; use clap::{CommandFactory, Parser}; @@ -11,11 +12,11 @@ use uuid::Uuid; include!("src/opt/ssh_authorizedkeys.rs"); include!("src/opt/kanidm.rs"); -fn main() { +fn main() -> Result<(), Error> { profiles::apply_profile(); let outdir = match env::var_os("OUT_DIR") { - None => return, + None => return Ok(()), Some(outdir) => outdir, }; @@ -29,33 +30,20 @@ fn main() { std::fs::create_dir(&comp_dir).expect("Unable to create completions dir"); } - generate_to( - Shell::Bash, - &mut SshAuthorizedOpt::command(), - "kanidm_ssh_authorizedkeys_direct", - comp_dir.clone(), - ) - .ok(); - generate_to( - Shell::Zsh, - &mut SshAuthorizedOpt::command(), - "kanidm_ssh_authorizedkeys_direct", - comp_dir.clone(), - ) - .ok(); + for shell in [Shell::Bash, Shell::Zsh] { + generate_to( + shell, + &mut SshAuthorizedOpt::command(), + "kanidm_ssh_authorizedkeys_direct", + comp_dir.clone(), + )?; - generate_to( - Shell::Bash, - &mut KanidmClientParser::command(), - "kanidm", - comp_dir.clone(), - ) - .ok(); - generate_to( - Shell::Zsh, - &mut KanidmClientParser::command(), - "kanidm", - comp_dir, - ) - .ok(); + generate_to( + shell, + &mut KanidmClientParser::command(), + "kanidm", + comp_dir.clone(), + )?; + } + Ok(()) }