View Source Runbox.Utils.Path (runbox v13.0.3)

Utilities for handling configured paths.

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.

Functions

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

Gets the Altworx root dir.

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

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"
@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.