mirror of
https://github.com/jbranchaud/til
synced 2026-01-04 23:58:01 +00:00
Add Root Directory Of A Project as an elixir til
This commit is contained in:
15
elixir/root-directory-of-a-project.md
Normal file
15
elixir/root-directory-of-a-project.md
Normal file
@@ -0,0 +1,15 @@
|
||||
# Root Directory Of A Project
|
||||
|
||||
Do you need the root directory of an elixir project? The
|
||||
[`File.cwd!/0`](http://elixir-lang.org/docs/stable/elixir/File.html#cwd!/0)
|
||||
function can help.
|
||||
|
||||
```elixir
|
||||
iex> File.cwd!
|
||||
"/home/dev/code/my_app"
|
||||
```
|
||||
|
||||
Keep in mind though, this will only work reliably with projects that are
|
||||
compiled using Mix.
|
||||
|
||||
[source](https://groups.google.com/forum/#!msg/elixir-lang-talk/Ls0eJDdMMW8/1Lmg5K2MAQAJ)
|
||||
Reference in New Issue
Block a user