This commit is contained in:
14
src/main.rs
14
src/main.rs
@@ -49,7 +49,12 @@ fn main() {
|
||||
.arg(arg!(-v --version <version> "Target version").required(false)),
|
||||
)
|
||||
.subcommand(Command::new("build").about("Build the source package"))
|
||||
.subcommand(Command::new("deb").about("Build the binary package"))
|
||||
.subcommand(
|
||||
Command::new("deb")
|
||||
.about("Build the binary package")
|
||||
.arg(arg!(-s --series <series> "Target distribution series").required(false))
|
||||
.arg(arg!(-a --arch <arch> "Target architecture").required(false))
|
||||
)
|
||||
.get_matches();
|
||||
|
||||
match matches.subcommand() {
|
||||
@@ -109,9 +114,12 @@ fn main() {
|
||||
std::process::exit(1);
|
||||
}
|
||||
}
|
||||
Some(("deb", _sub_matches)) => {
|
||||
Some(("deb", sub_matches)) => {
|
||||
let cwd = std::env::current_dir().unwrap();
|
||||
if let Err(e) = pkh::deb::build_binary_package(Some(&cwd)) {
|
||||
let series = sub_matches.get_one::<String>("series").map(|s| s.as_str());
|
||||
let arch = sub_matches.get_one::<String>("arch").map(|s| s.as_str());
|
||||
|
||||
if let Err(e) = pkh::deb::build_binary_package(arch, series, Some(cwd.as_path())) {
|
||||
error!("{}", e);
|
||||
std::process::exit(1);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user