Last active
February 9, 2018 23:28
-
-
Save fertapric/15e88de17d12558b65be7966fbdf31c0 to your computer and use it in GitHub Desktop.
Prompt Mix env on IEX (with colors)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
env_colors = %{"prod" => ANSI.red(), "dev" => ANSI.green(), "test" => ANSI.green()} | |
env = System.get_env("MIX_ENV") || "dev" | |
colored_env = Map.get(env_colors, env, ANSI.yellow()) <> env <> ANSI.reset() | |
IEx.configure( | |
default_prompt: "%prefix(#{colored_env},%counter)>", | |
alive_prompt: "%prefix(#{colored_env},%node,%counter)>" | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment