简体   繁体   English

Elixir 混合自动确认

[英]Elixir mix auto acknowledge

I want to run tests of my Phoenix app on Travis-CI.我想在 Travis-CI 上运行我的 Phoenix 应用程序的测试。

Log excerpt:日志摘录:

$ MIX_ENV=test mix do deps.get, compile, test

Could not find hex, which is needed to build dependency :phoenix

Shall I install hex? [Yn] 

When it comes to fetching and installing dependencies, it asks if it should install hex .在获取和安装依赖项时,它会询问是否应该安装hex I was wondering if I can pass a --yes option to mix so that it doesn't ask but just installs?我想知道我是否可以通过--yes选项来混合,这样它就不会询问而只是安装?

You can add this command to your before_install section in .travis.yml您可以将此命令添加到 .travis.yml 中的 before_install 部分

  • mix local.hex --force混合 local.hex --force

After of course, you've already installed elixir in a previous command.当然,您已经在之前的命令中安装了 elixir。 I cargo culted this .travis.yml from an existing elixir project on github.我从 github 上现有的 elixir 项目中提取了这个 .travis.yml。

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"

As with any unix command, you could pipe yes into the mix command:与任何 unix 命令一样,您可以将yes给 mix 命令:

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

But there are some warnings about this solution in the comments below.但是在下面的评论中有一些关于这个解决方案的警告。 I recommend using the top voted solution!我建议使用票数最高的解决方案!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在Elixir中执行十六进制编码? - How to perform hex encoding in Elixir? 如何解决`非法指令:4` elixir 包崩溃 - How to solve`illegal instruction: 4` crash of elixir package 如何获取每个环境的Elixir依赖关系? - How to fetch Elixir dependencies per environment? 在混合任务列表中找不到十六进制任务 - Hex tasks not found in list of mix tasks 如何使用Elixir打包/解开十六进制字符串(高位优先) - How to pack / unpack a hex string (high nibble first) with Elixir 长生不老药+十六进制 - 不推荐使用 Ranch_proxy_protocol ssl:ssl_accept 3 的十六进制错误 - elixir+hex - getting hex error for ranch_proxy_protocol ssl:ssl_accept 3 deprecated 如何制作一个包含 ascii 文本和 ascii 十六进制代码的混合常量字符串? - How to make a mix constant string that has ascii text as well as ascii hex codes in it? C ++自动更新程序 - C++ Auto update program 如何将调色板 (n=5) 与第二个调色板 (n=4) 加上矩阵中的亮度变量 (n=4) 最佳混合(总共 5*4*4=80 种颜色) - How to mix optimally a color palette (n=5) with a second color palette (n=4) plus a luminance variable (n=4) in a matrix (total 5*4*4=80 colors) f-strings 可以自动填充到 output 上的 [下一个] 偶数位数吗? - Can f-strings auto-pad to [the next] even number of digits on output?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM