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
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
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 ![]()
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #elixirconf-us
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #security
- #hex









