refactor: App now crashes if home isn't set.

This commit is contained in:
2026-06-24 14:34:47 -04:00
parent 3331a40053
commit bb6c067b97
2 changed files with 6 additions and 6 deletions

View File

@@ -208,17 +208,19 @@ find_git_roots :: proc(
}
search_paths :: proc(cfg: Config, allocator := context.allocator) -> [dynamic]string {
// TODO: handle error
home, _ := os.user_home_dir(context.temp_allocator)
home, err := os.user_home_dir(context.temp_allocator)
if err != nil {
panic("Failed to find home directory")
}
paths, _ := new_clone(cfg.scan_config.include, allocator)
paths := new_clone(cfg.scan_config.include, allocator)
for &include in paths {
// TODO: Do we need to manually expand ~/ in odin?
expanded, _ := strings.replace(include, "~", home, 1, allocator)
if filepath.is_abs(expanded) {
include = expanded
} else {
// TODO: show errors?
resolved, err := filepath.abs(expanded, allocator)
if err == nil {
include = resolved