automotiveMastermind / prompt

A spectacular prompt for *nix distributions.
MIT License
10 stars 6 forks source link

feat: add zsh and dash support to prompt #32

Closed dmccaffery closed 4 years ago

dmccaffery commented 4 years ago

NOTES:

Adding support for zsh allows new installations of macOS Catalina to use the default shell, which was switched to zsh for this release. Future builds of macOS are likely to drop built-in support for bash due to the GPLv3 license.

When bootstrapping prompt from bash; prompt will update and use bash. When bootstrapping prompt from zsh; prompt will update and use zsh. When bootstrapping from any other shell, prompt will use bash by default.

A command line argument can be used to to select the prompt at install time. Switching prompts can be done via new use-bash and use-zsh commands.

BREAKING CHANGE:

While this is not an actual breaking change, quite a bit has changed with regard to how prompt actually works. We want to notify users that this may result is some level of bugs as test coverage of scripts like this one is incredibly difficult.

sjk07 commented 4 years ago

@dmccaffery sweet stuff! But, all of linux has broken! 😭 Can we get these tests passing again?

dmccaffery commented 4 years ago

@sjk07 I noticed the docker tests were failing and was hoping you might help take a look; I looked at it and if you comment out the smoke test lines, then build the container, then run with docker -it <SHA> the exact same line you commented out; it works flawlessly.

It has something to do with the $SHELL variable not being respected from the environment from the previous docker layer. I tried using the SHELL directive in the Dockerfile, but that doesn’t help either.

Ultimately; everything works in real-world testing — it’s just failing in docker.

Maybe hardcoding the path to the shell location in the smoke test? /home/linuxbrew/.linuxbrew/bin/zsh for example? That defeats the point of proving that the chsh fires (although I know it does).

dmccaffery commented 4 years ago

You can easily build the containers using:

./docker/build.sh # build everything

OR

./docker/build.sh centos # build a specific platform

dmccaffery commented 4 years ago

HOLD: should enable bootstrap / install of a specific version of prompt just in case this big change causes any issues for folks.

sjk07 commented 4 years ago

@dmccaffery Should we make upgrading major versions optional with an easy rollback strategy if things mess up?

EDIT: I know we have the backup folder. just thinking of a more automated way to keep things easy for the user

dmccaffery commented 4 years ago

@sjk07 -- I think I got the builds all fixed (will see if they pass in a few minutes) -- also added support for installing a specific version of prompt, both through bootstrapping and/or update-prompt commands -- this is a viable fallback strategy should something completely explode for some reason.