Make roc_cache_dir() panic if it can't find $HOME

This commit is contained in:
Richard Feldman 2022-11-20 20:48:09 -05:00
parent 4987fe1656
commit 7d2fa63dca
No known key found for this signature in database
GPG key ID: F1F21AA5B1D9E43B
7 changed files with 31 additions and 61 deletions

View file

@ -54,16 +54,13 @@ pub fn compile_to_mono<'a, 'i, I: Iterator<Item = &'i str>>(
let src_dir = PathBuf::from("fake/test/path");
let (bytes_before_expr, module_src) = promote_expr_to_module(arena, defs, expr);
let exposed_types = Default::default();
let roc_cache_dir = cache::roc_cache_dir().unwrap_or_else(|| {
todo!("Gracefully handle not being able to find default Roc cache dir.")
});
let loaded = roc_load::load_and_monomorphize_from_str(
arena,
filename,
module_src,
src_dir,
exposed_types,
RocCacheDir::Persistent(roc_cache_dir.as_path()),
RocCacheDir::Persistent(cache::roc_cache_dir().as_path()),
LoadConfig {
target_info,
render: roc_reporting::report::RenderTarget::ColorTerminal,