PathHelper (path_helper v0.1.0)
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 function
cwd()
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 function
relative_path(filename)
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"