Runbox.Utils.Path (runbox v7.0.1)

Utilities for handling configured paths.

Link to this section Summary

Functions

Gets the Altworx root dir.

Resolves a possibly relative path to absolute path by prepending the Altworx root dir (see set_altworx_root/1).

Sets where the Altworx root dir is. Configuration and data dirs are supposed to be relative to the root dir. It is typically the directory which the VM is started in.

Link to this section Functions

Link to this function

altworx_root_env_var()

Link to this function

get_altworx_root()

@spec get_altworx_root() :: String.t() | nil

Gets the Altworx root dir.

Link to this function

resolve_path(path)

Resolves a possibly relative path to absolute path by prepending the Altworx root dir (see set_altworx_root/1).

examples

Examples

iex> Path.set_altworx_root("/opt/altworx")
:ok
iex> Path.resolve_path("/already/absolute/path")
"/already/absolute/path"
iex> Path.resolve_path("some/../relative/path")
"/opt/altworx/relative/path"
Link to this function

set_altworx_root(path)

@spec set_altworx_root(String.t()) :: :ok

Sets where the Altworx root dir is. Configuration and data dirs are supposed to be relative to the root dir. It is typically the directory which the VM is started in.