First works toward generalizing file backup code, applying to both
config.fish file and now fish_prompt.fish too. This avoids clean
installs which start with theme issues.
Instead of having every plugin function inside the same file, which
increases the loading time unnecessarily and is not fishy, source the
`uninstall.fish` file for the plugin before the `uninstall_$plugin_name`
event is emitted.
In order to pro-actively diagnose an issue on someone's computer, a
`omf doctor' command is being added. This command will initially check
errors that could cause a theme to not be loaded, but in the future more
checks are going to be added to prevent issues from being created for
problems that are fixable by the Oh My Fish user alone.
Fixes an issue with history between shell reloads via refresh function call.
As `exec` replaces the current process in a non-gently fashion, the
persistent history could be out of sync with the in-memory history.
Calling `history --save` before `exec` should force the shell to persist the
history before replacing the current process.
When calling `omf destroy`, the `bundle` file is completely erased
because we are calling `remove_package` on each installed package. We
don't want to erase that file, we just want to emit the event and later
on remove the code, which is done with `rm -rf "$OMF_PATH"`.
Travis does not provide the original repository branch name on any
environment variable. We are getting the information from the GitHub
API instead.
The misleading environment variable `TRAVIS_BRANCH` returns `master`
instead:
> TRAVIS_BRANCH: For builds not triggered by a pull request this is the
name of the branch currently being built; whereas for builds triggered
by a pull request this is the name of the branch targeted by the pull
request (in many cases this will be master).
Reference: http://docs.travis-ci.com/user/environment-variables/
This Dockerfile creates an ubuntu machine with fish-shell and the
dependencies we use on our test suite installed.
It does not install Oh My Fish, which one might find weird (I do). Not
confident that this is the best approach, but it's the best I could find
at the moment.
Stash is a shell script that does not support `--git-dir`, not even on
latest versions. We need to use `git -C` which was only added on recent
versions of `git`.
`omf update` will fail in case omf need needs to run `git stash` and
git is not compatible.