lune-packaging/package/action/src/main.rs

34 lines
878 B
Rust
Raw Normal View History

use std::fs::File;
use action::download::{download_release, install_lune};
2023-09-30 08:50:03 +01:00
use tracing::Level;
use tracing_unwrap::ResultExt;
fn main() {
2023-09-30 08:50:03 +01:00
if cfg!(debug_assertions) {
better_panic::install();
} else {
// Check for is_debug in github actions
tracing_subscriber::fmt()
.with_max_level(Level::DEBUG)
.init();
}
2023-09-30 08:50:03 +01:00
let (zip_path, meta) =
download_release().expect_or_log("failed to download latest lune release");
install_lune(
File::open(&zip_path).expect(
format!(
"failed to open downloaded lune release zip file @ {}",
zip_path.to_string_lossy().to_string()
)
.as_str(),
),
meta,
)
2023-09-30 08:50:03 +01:00
.expect_or_log(
"failed to install lune. did we not have perms to write to the required directories?",
);
}