matchai / spacefish

🚀🐟 The fish shell prompt for astronauts
https://spacefish.matchai.dev
MIT License
963 stars 77 forks source link

feat: Add elixir section #190

Closed bradcypert closed 5 years ago

bradcypert commented 5 years ago

This PR adds in support for Elixir into SpaceFish. This matches parity of the feature in https://github.com/denysdovhan/spaceship-prompt

Description

Adds in a section for Elixir support into SpaceFish. It checks against iex, exenv and elixir to see if you have an elixir install and only shows in directories that contain mix.ex or other elixir files. It's configureable via the following options:

Variable Default Meaning
SPACEFISH_ELIXIR_SHOW true Show current Elixir version
SPACEFISH_ELIXIR_PREFIX $SPACEFISH_PROMPT_DEFAULT_PREFIX Prefix before the elixir section
SPACEFISH_ELIXIR_SUFFIX $SPACEFISH_PROMPT_DEFAULT_SUFFIX Suffix after the elixir section
SPACEFISH_ELIXIR_SYMBOL 💧· Character to be shown before Elixir version
SPACEFISH_ELIXIR_COLOR magenta Color of Elixir section

Motivation and Context

This helps maintain the mission of absolute parity with Spaceship.

Types of changes

Screenshots (if appropriate):

How Has This Been Tested?

This was tested by writing and running unit tests for my code. I wasn't able to find the build instructions, so I'm unsure how to actually build and test this locally, however.

Checklist:

bradcypert commented 5 years ago

@matchai thanks for looking over my PR and showing me a more idiomatic way to handle the search of a string. I'm not 100% sure why tests would be getting a different version on Linux. As far as I know, the Linux image shouldn't have elixir preinstalled on it and it doesn't look like the travis.yml is adding any elixir stuff.

bradcypert commented 5 years ago

@halostatue You were right! I think I just needed to set a value for the Elixir version.

matchai commented 5 years ago

@all-contributors please add @halostatue for reviewing

allcontributors[bot] commented 5 years ago

@matchai

I couldn't determine any contributions to add, did you specify any contributions? Please make sure to use valid contribution names.

matchai commented 5 years ago

@all-contributors please add @halostatue for review

allcontributors[bot] commented 5 years ago

@matchai

I've put up a pull request to add @halostatue! :tada:

matchai commented 5 years ago

:tada: This PR is included in version 2.6.0 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket: