eyelight93

eyelight93

Path name in Umbrella Apps

Hi, I’m having an issue with the Path.absname/1 function.

The function will return the absolute path of current umbrella app. Let’s say I have two app in an umbrella project called app1 and app2.

Path.absname(“something”) will return different result based on where I called it.

So how do I always get the result some_path/umbrella/apps/app1/something even if I called the function inside app2?

Most Liked

LostKobrakai

LostKobrakai

It does not. Application.app_dir does internally also just use :code api and those point to the files in the _build directory and not the source directory.

NobbZ

NobbZ

In theory it should be resolved relative to your current working dir, so I’m wondering why you get your apps in there…

Kurisu

Kurisu

Maybe could you try Application.app_dir/2 ?

Application.app_dir(:app1, "something") should always return some_path/umbrella/apps/app1/something even if you call it from app2.

Where Next?

Popular in Questions Top

baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
New
lastday4you
I wanted to check elixir version in phoenix because i found that my elixir is 1.5 but when i use Enum.chunk_by it said the function is un...
New
belgoros
I’m not a pro in using Regex and can’t figure out why the following behaviour happens, especially if we take into account the difference ...
New
stefanluptak
Hello everybody, usually, I use a 29" ultra-wide monitor for VSCode which can easily accomodate explorer (files panel) + file with code ...
New
siddhant3030
Hi, I have to write a raw query for one of my project. But till now I have used ecto queries and don’t have much experience writing raw ...
New
dblack
I’ve got an issue with an app and I’ve no idea of how to troubleshoot it. I’m hoping someone here might have seen something similar. I p...
New
romenigld
I am trying to run a deploy with docker and I successfully runned with this command: docker build -t romenigld/blog-prod . but when I t...
New

Other popular topics Top

Qqwy
Original source of discussion: This topic on the Pragmatic Programmers’ Functional Web Development with Elixir, OTP, and Phoenix forum. ...
New
New
sen
Hi All, I set a environment variables in dev.exs , like below code. when i start server, how can i set the ${enable} value? thanks. d...
New
AstonJ
Seen any cool LiveView demos, sample apps or examples? Please post them here! :003:
New
romenigld
I am trying to run a deploy with docker and I successfully runned with this command: docker build -t romenigld/blog-prod . but when I t...
New
senggen
Erlang/OTP 25 [erts-13.2.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] 15:22:35.803 [error] gen_event {lager_file_backend...
New

We're in Beta

About us Mission Statement