scamp.utilities.resolve_path

scamp.utilities.resolve_path(path: str) str[source]

Resolves the given path based on a variety of prefixes.

Parameters:

path – A path, possibly prefixed by “/”, “~/”, or “%PKG/”. A prefix of “/” will be interpreted as an absolute path, a prefix of “~/” will be interpreted as relative to the user’s home directory, a prefix of “%PKG/” will be interpreted as relative to the package source directory, and an unprefixed path will be interpreted as relative to the current working directory.

Returns:

the resolved path