diff --git a/.config/wezterm/wlib.lua b/.config/wezterm/wlib.lua index 51933a9d..7aa0beea 100644 --- a/.config/wezterm/wlib.lua +++ b/.config/wezterm/wlib.lua @@ -35,40 +35,6 @@ function M.Table.merge(...) return ret end ---- Returns the path to the users home, note this string needs to be regularized as ---- this is used on both windows and unix. ---- @return string -function M.determine_home_path() - -- This helps give a better error message - -- if we are unable to find their home dir - -- from a environment variable - local checked_env_vars = {} - - -- Attempt to get UNIX home - local unix_home_var = "HOME" - local unix_home = os.getenv(unix_home_var) - table.insert(checked_env_vars, unix_home_var) - -- This style is chosen as a guard so it's easier - -- to extend in the future - if unix_home then - return unix_home - end - - -- Attempt to get Windows home - local win_home_drive = os.getenv("HOMEDRIVE") - local win_home = os.getenv("HOMEPATH") - if win_home and win_home_drive then - return win_home_drive .. win_home - end - - -- NOTE: This will error if it cannot determine the home path - error( - "Unable to determine user's home directory, checked environment variables:\n\n" - .. M.Table.dump(checked_env_vars) - .. "\n\n" - ) -end - --- Return a table with `name` representing the OS name and `arch` representing --- the architecture. ---