fix(sdk): Fix bundle names in archive file index

This commit is contained in:
Lucas Schwiderski 2023-02-25 16:41:42 +01:00
parent 5a3c19fb3e
commit 7c36299477
Signed by: lucas
GPG key ID: AA12679AAA6DF4D8

View file

@ -5,6 +5,7 @@ use std::path::{Path, PathBuf};
use color_eyre::eyre::{self, Context};
use color_eyre::Result;
use sdk::murmur::IdString64;
use sdk::Bundle;
use zip::ZipWriter;
@ -61,7 +62,10 @@ impl Archive {
let mut file_map = HashMap::new();
for bundle in self.bundles.iter() {
let bundle_name = bundle.name().clone();
let bundle_name = match bundle.name() {
IdString64::Hash(_) => eyre::bail!("bundle name must be known as string. got hash"),
IdString64::String(s) => s,
};
let map_entry: &mut HashSet<_> = file_map.entry(bundle_name).or_default();