mmyers

mmyers

Run elixir -S script.exs with relative path

I’m trying to run a simple exs script from the command line, and it seems I have to have the full path to the file to make it work.
Is it possible to run elixir -S test.exs where test.exs is in the current directory? or do I always have to have the full path?
I’ve also tried elixir -S ./test.exs and that doesn’t work either.
I always get the error: -S : Could not find executable test.exs

I would like to use a script to run some simple file system commands cross-platform, but if I have to specify a full path, then this idea is already not cross-platform.

Environments:

Windows:
    Erlang/OTP 21 [erts-10.3] [64-bit] [smp:12:12] [ds:12:12:10] [async-threads:1]
    Elixir 1.10.0 (compiled with Erlang/OTP 21)                                   
WSL:
    Erlang/OTP 22 [erts-10.7] [source] [64-bit] [smp:12:12] [ds:12:12:10] [async-threads:1] [hipe]
    Elixir 1.10.2 (compiled with Erlang/OTP 22)

Marked As Solved

NobbZ

NobbZ

Drop the -S.

-S is explicitely designed to resolve the script name from PATH. At least this is how I understand its entry in elixir --help.

Last Post!

mmyers

mmyers

Of course elixir test.exs without the -S works.
Thanks for helping so many of us Elixir newbies that don’t always read the docs closely :blush:

Where Next?

Popular in Questions Top

openscript
Hello! Sorry for this astonishing simple question, but I’m really stuck. I try to set up the intellij-elixir plugin, but I don’t know ho...
New
joeerl
Hello again - after a longish gap I’ve decided I really must dig into Elixir and see what’s been happening here - so I have a few questio...
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
komlanvi
Hi everyone, I was playing with phoenix liveView but I run into an issue. I have a form and want to validate each input text when the te...
New
bsollish-terakeet
Credo is smart enough to check for (something like) this: assert length(the_list) == 0 with this response: Checking if an enum is empt...
New
albydarned
Hello all! I am typing this post from my new MacBook Pro with the M1 chip. I’m loving it so far, and will probably use it as my daily dr...
New
SoCreat
i’m a new one to elixir which editor can i use vs code? or atom? Thanks! :smiley:
New

Other popular topics Top

rms.mrcs
Hi, I need to transform a list of numbers into a map where the keys are the indexes and the values are the original values of the list. ...
New
minhajuddin
I have seen a lot of code which picks the first element from a list using Enum.at(0) instead of List.first. Is there a reason why people ...
New
vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
nsuchy
Hi. I’ve noticed that Windows Powershell has it’s own IEX command and you cannot access Elixir’s IEX due to the conflict. This isn’t a cr...
New
dogweather
I wrote this comment on r/haskell, and it’s not popular there. :wink: But I think I’m on to something… Haskell reminds me of Java, and e...
New
sergio
Kind of like when jquery came out, it was super necessary. Existing drag and drop libraries have a bunch of baggage to support old browse...
New