4 Commits
Author SHA1 Message Date
Jan-Bulthuis bbb19754bd fix: Use correct assets path 2026-04-02 19:26:49 +02:00
Jan-Bulthuis c2e208a20b fix: Add Entrypoint to container 2026-04-02 19:06:20 +02:00
Jan-Bulthuis b157703162 feat: Release hotfix 2026-04-02 18:18:25 +02:00
Jan-Bulthuis ea07d11034 fix: Replace unwrap with expect for better logging 2026-04-02 18:18:02 +02:00
5 changed files with 20 additions and 10 deletions

No files matched your search

Generated
+1 -1
View File
@@ -1367,7 +1367,7 @@ dependencies = [
[[package]]
name = "karnaugh"
version = "0.1.0"
version = "0.1.3"
dependencies = [
"axum",
"clap",
+1 -1
View File
@@ -1,6 +1,6 @@
[package]
name = "karnaugh"
version = "0.1.0"
version = "0.1.3"
edition = "2024"
[dependencies]
+3 -3
View File
@@ -21,9 +21,9 @@
rec {
packages.karnaugh = pkgs.rustPlatform.buildRustPackage (final: {
pname = "karnaugh";
version = "0.1.0";
version = "0.1.3";
src = self;
cargoHash = "sha256-4jmvuQiQz5TCkY//L2qyx0AiDTxHu8EocFfysgaTaHU=";
cargoHash = "sha256-HwwvbYf9hKBANbIoxBQFOgya3K7SwWZCPZKvLGB057U=";
});
packages.container = pkgs.dockerTools.buildImage {
name = "karnaugh";
@@ -36,7 +36,7 @@
};
config = {
Cmd = ["/bin/karnaugh"];
Entrypoint = [ "/bin/karnaugh" ];
};
};
packages.default = packages.karnaugh;
+6 -2
View File
@@ -108,8 +108,12 @@ async fn main() {
let socket = SocketAddrV4::new(Ipv4Addr::new(0, 0, 0, 0), state.config.port);
info!("Serving Karnaugh on socket {}", socket);
let listener = tokio::net::TcpListener::bind(socket).await.unwrap();
axum::serve(listener, app).await.unwrap();
let listener = tokio::net::TcpListener::bind(socket)
.await
.expect(&format!("Failed to bind to socket {}", socket));
axum::serve(listener, app)
.await
.expect("Failed to serve site");
}
async fn root_handler(State(state): State<AppState>) -> impl IntoResponse {
+9 -3
View File
@@ -138,7 +138,10 @@ impl<'a> DocumentWorld<'a> {
}
fn get_package(&self, spec: &PackageSpec) -> PackageResult<PathBuf> {
let path = get_package_path(&VirtualPath::new("").unwrap(), spec);
let path = get_package_path(
&VirtualPath::new("").expect("Failed to create empty virtual path"),
spec,
);
let path = path.realize(&self.context.config.packages_root);
if path.exists() {
@@ -177,6 +180,9 @@ impl<'a> DocumentWorld<'a> {
}
fn get_package_path(file_path: &VirtualPath, spec: &PackageSpec) -> VirtualPath {
let package_path = VirtualPath::new(format!("{}/{}", spec.name, spec.version)).unwrap();
package_path.join(file_path.get_without_slash()).unwrap()
let package_path = VirtualPath::new(format!("{}/{}", spec.name, spec.version))
.expect("Failed to create virtual path representing package path.");
package_path
.join(file_path.get_without_slash())
.expect("Failed to join file path into package path.")
}