erlang-escript

Escript: setting code path relative to script directory

本小妞迷上赌 提交于 2020-01-23 05:54:28
问题 When I try to set a relative code path in a escript with -pz like this #!/usr/bin/env escript %% -*- erlang -*- %%! -pz ../dir-of-some-beams The path is interpreted relative to the directory from where I run the escript from, which renders it useless for setting the path relative to the script location. My current "workaround" is using a absolute path which is annoying since all this is part of a repository and I don't want it to be location dependent. So how can I set the code path relative

Escript: setting code path relative to script directory

荒凉一梦 提交于 2020-01-23 05:53:11
问题 When I try to set a relative code path in a escript with -pz like this #!/usr/bin/env escript %% -*- erlang -*- %%! -pz ../dir-of-some-beams The path is interpreted relative to the directory from where I run the escript from, which renders it useless for setting the path relative to the script location. My current "workaround" is using a absolute path which is annoying since all this is part of a repository and I don't want it to be location dependent. So how can I set the code path relative

Escript: setting code path relative to script directory

夙愿已清 提交于 2019-12-05 04:35:12
When I try to set a relative code path in a escript with -pz like this #!/usr/bin/env escript %% -*- erlang -*- %%! -pz ../dir-of-some-beams The path is interpreted relative to the directory from where I run the escript from, which renders it useless for setting the path relative to the script location. My current "workaround" is using a absolute path which is annoying since all this is part of a repository and I don't want it to be location dependent. So how can I set the code path relative to the directory the escript is located in? Just found it out myself: At the beginning of main add code