mirror of
https://github.com/kanidm/kanidm.git
synced 2025-02-23 12:37:00 +01:00
parent
dbf476fe5e
commit
85c2b0fd82
|
@ -19,6 +19,10 @@ ${SUDOCMD} apt-get install -y \
|
||||||
git \
|
git \
|
||||||
build-essential \
|
build-essential \
|
||||||
|
|
||||||
|
if [ -z "${PACKAGING}" ]; then
|
||||||
|
PACKAGING=0
|
||||||
|
fi
|
||||||
|
|
||||||
if [ "${PACKAGING}" -eq 1 ]; then
|
if [ "${PACKAGING}" -eq 1 ]; then
|
||||||
${SUDOCMD} apt-get install -y \
|
${SUDOCMD} apt-get install -y \
|
||||||
devscripts \
|
devscripts \
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
#![allow(dead_code)]
|
#![allow(dead_code)]
|
||||||
|
|
||||||
use std::env;
|
use std::env;
|
||||||
|
use std::io::Error;
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
|
|
||||||
use clap::{CommandFactory, Parser};
|
use clap::{CommandFactory, Parser};
|
||||||
|
@ -11,11 +12,11 @@ use uuid::Uuid;
|
||||||
include!("src/opt/ssh_authorizedkeys.rs");
|
include!("src/opt/ssh_authorizedkeys.rs");
|
||||||
include!("src/opt/kanidm.rs");
|
include!("src/opt/kanidm.rs");
|
||||||
|
|
||||||
fn main() {
|
fn main() -> Result<(), Error> {
|
||||||
profiles::apply_profile();
|
profiles::apply_profile();
|
||||||
|
|
||||||
let outdir = match env::var_os("OUT_DIR") {
|
let outdir = match env::var_os("OUT_DIR") {
|
||||||
None => return,
|
None => return Ok(()),
|
||||||
Some(outdir) => outdir,
|
Some(outdir) => outdir,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -29,33 +30,20 @@ fn main() {
|
||||||
std::fs::create_dir(&comp_dir).expect("Unable to create completions dir");
|
std::fs::create_dir(&comp_dir).expect("Unable to create completions dir");
|
||||||
}
|
}
|
||||||
|
|
||||||
generate_to(
|
for shell in [Shell::Bash, Shell::Zsh] {
|
||||||
Shell::Bash,
|
generate_to(
|
||||||
&mut SshAuthorizedOpt::command(),
|
shell,
|
||||||
"kanidm_ssh_authorizedkeys_direct",
|
&mut SshAuthorizedOpt::command(),
|
||||||
comp_dir.clone(),
|
"kanidm_ssh_authorizedkeys_direct",
|
||||||
)
|
comp_dir.clone(),
|
||||||
.ok();
|
)?;
|
||||||
generate_to(
|
|
||||||
Shell::Zsh,
|
|
||||||
&mut SshAuthorizedOpt::command(),
|
|
||||||
"kanidm_ssh_authorizedkeys_direct",
|
|
||||||
comp_dir.clone(),
|
|
||||||
)
|
|
||||||
.ok();
|
|
||||||
|
|
||||||
generate_to(
|
generate_to(
|
||||||
Shell::Bash,
|
shell,
|
||||||
&mut KanidmClientParser::command(),
|
&mut KanidmClientParser::command(),
|
||||||
"kanidm",
|
"kanidm",
|
||||||
comp_dir.clone(),
|
comp_dir.clone(),
|
||||||
)
|
)?;
|
||||||
.ok();
|
}
|
||||||
generate_to(
|
Ok(())
|
||||||
Shell::Zsh,
|
|
||||||
&mut KanidmClientParser::command(),
|
|
||||||
"kanidm",
|
|
||||||
comp_dir,
|
|
||||||
)
|
|
||||||
.ok();
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue