Skip to content

Commit fa0c1f5

Browse files
committed
Pick elixir command based on OS #747
1 parent 1c0af54 commit fa0c1f5

File tree

4 files changed

+68
-41
lines changed

4 files changed

+68
-41
lines changed

fnl/conjure/client/elixir/stdio.fnl

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
(local mapping (autoload :conjure.mapping))
77
(local stdio (autoload :conjure.remote.stdio))
88
(local str (autoload :conjure.nfnl.string))
9+
(local util (autoload :conjure.util))
910
(local vim _G.vim)
1011

1112
;;============================================================
@@ -46,12 +47,16 @@
4647

4748
(local M (define :conjure.client.elixir.stdio))
4849

50+
(local iex-command (if (= :windows (util.os))
51+
"iex.bat --no-color"
52+
"iex --no-color"))
53+
4954
(config.merge
5055
{:client
5156
{:elixir
5257
{:stdio
53-
{:command "iex --no-color" ; M.start will overwrite this.
54-
:standalone_command "iex --no-color"
58+
{:command iex-command ; M.start will overwrite this.
59+
:standalone_command iex-command
5560
:prompt_pattern "iex%(%d+%)> "}}}})
5661

5762
(when (config.get-in [:mapping :enable_defaults])

fnl/conjure/util.fnl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
11
(local {: autoload : define} (require :conjure.nfnl.module))
22
(local a (autoload :conjure.nfnl.core))
3+
(local vim _G.vim)
34

45
(local M (define :conjure.util))
56

7+
(fn M.os []
8+
"Returns 'windows' or 'unix' based on the path separator."
9+
(if (= "\\" (string.sub package.config 1 1))
10+
:windows
11+
:unix))
12+
613
(fn M.wrap-require-fn-call [mod f]
714
"We deliberately don't pass args through here because functions can behave
815
very differently if they blindly accept args. If you need the args you should

lua/conjure/client/elixir/stdio.lua

Lines changed: 44 additions & 37 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lua/conjure/util.lua

Lines changed: 10 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)