Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 1 addition & 29 deletions src/directories.gleam
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import simplifile
/// Return the first environment variable from the list
/// that is set and is a valid directory
fn check_dir_from_env(vars: List(String)) -> Result(String, Nil) {
vars |> list.filter_map(envoy.get(_)) |> check_dirs
vars |> list.filter_map(envoy.get) |> check_dirs
}

/// Return the first directory from the list that exists, or Nil
Expand Down Expand Up @@ -243,31 +243,3 @@ pub fn state_dir() -> Result(String, Nil) {
platform.OtherOs(os) -> other_os_message(os)
}
}

pub fn main() {
io.print("Current Platform: ")
let _ = io.debug(platform.os())
io.println("===")
io.print("Temp Directory: ")
let _ = io.debug(tmp_dir())
io.print("Home Directory: ")
let _ = io.debug(home_dir())
io.print("Cache Directory: ")
let _ = io.debug(cache_dir())
io.print("Config Directory: ")
let _ = io.debug(config_dir())
io.print("Config Directory (Local): ")
let _ = io.debug(config_local_dir())
io.print("Data Directory: ")
let _ = io.debug(data_dir())
io.print("Data Directory (Local): ")
let _ = io.debug(data_local_dir())
io.print("Executables Directory: ")
let _ = io.debug(executable_dir())
io.print("Preferences Directory: ")
let _ = io.debug(preference_dir())
io.print("Runtime Directory: ")
let _ = io.debug(runtime_dir())
io.print("State Directory: ")
let _ = io.debug(state_dir())
}