PathHelper (path_helper v0.1.2)

Provides helper functions for accessing relative files when a program is invoked from outside of its directory. This is useful in .exs scripts that deal with local files but are symlinked to /usr/bin or similar.

Link to this section Summary

Functions

Prints the working directory the file running this function resides in.

Resolves to an absolute path pointing to the relative file given.

Link to this section Functions

Link to this macro

cwd()

(macro)

Prints the working directory the file running this function resides in.

examples

Examples

iex> PathHelper.cwd()
"/home/computer/code/path_helper/lib"
Link to this macro

relative_path(filename)

(macro)

Resolves to an absolute path pointing to the relative file given.

examples

Examples

iex> PathHelper.relative_path("foo.txt")
"/home/computer/code/path_helper/lib/foo.txt"