Elixir mix auto acknowledge

My team and I are using Elixir and Travis CI for a project, when it comes to fetching and installing dependencies, it asks if it should install hex . I was wondering if I can pass a --yes option to mix so that it doesn’t ask but just installs?

Thanks, Cats.

Hey @Cizzats,

Couple of things here, you can add this command to your before_install hook in your .travis.yml:

mix local.hex --force

You’ve already installed Elixir in a previous command with the .travis.yml below:

language: erlang
env:
  - ELIXIR="v1.0.0"
otp_release:
  - 17.1
before_install:
  - mkdir -p vendor/elixir
  - wget -q https://github.com/elixir-lang/elixir/releases/download/$ELIXIR/Precompiled.zip && unzip -qq Precompiled.zip -d vendor/elixir
  - export PATH="$PATH:$PWD/vendor/elixir/bin"
  - mix local.hex --force
script: "MIX_ENV=test mix do deps.get, test"

The second fix would be as with any UNIX command, you can pipe the yes into the mix command, as follows:

yes | MIX_ENV=test mix do deps.get, compile, test
1 Like