Commit Graph

182 Commits (master)

Author SHA1 Message Date
Derek Willian Stavis fcc9d4dc0a key bindings: test if reload function is available (#368)
This fixes a rare case when fish's builtin function
__fish_reload_key_bindings is not defined.
8 years ago
Stephen M. Coakley e4bd035f15 Fix omf update exit status (#365) 8 years ago
Stephen M. Coakley e9fb8ff3db Add hooks system for packages (#286) 8 years ago
Stephen M. Coakley 8ce0f3bd50 Align help text to use less extra space (#356) 8 years ago
Derek Willian Stavis 5095b5ba31 destroy: fix glob behavior on fish 2.3.0 (#327) 8 years ago
Derek Willian Stavis 0ca26d01e2 Fix theme key bindings (#334)
* init: load only key bindings from current theme

* theme: reload key bindings on theme change
8 years ago
Pablo Santiago Blum de Aguiar db66200ca9 templates: use `plugin` for plugins and `theme` for themes 8 years ago
Pablo Santiago Blum de Aguiar befebda9f2 templates: consistently use newlines before sections 8 years ago
Pablo Santiago Blum de Aguiar 7a815f32f0 templates: use https for all links 8 years ago
Luís Fiolhais 9afb439844 Fix autoload functions (#335) 8 years ago
Derek Willian Stavis a164ebdd5d init: rewrite init process (#260)
* init: rewrite init process

Now use pure globbing to generate 100% valid function and
completion paths, effectively splitting the init process in two
steps, one which paths are added, and other when initialization
is done (sourcing init).

This initialization code introduces a new interface for
`init.fish` hook, which deprecates the previously used event
model. The new interface injects three variables into `init.fish`:
path, package and bundle. This variables can be used by the
package to autoload paths, use bundled files, etc.

Also supports key bindings by sourcing
$OMF_CONFIG/key_bindings.fish and also key_bindings.fish in
packages (plugins and themes) root directories. This is done
when fish_user_key_bindings is called.

* omf: migrate to new init hook

* omf/templates: migrate to new init and uninstall hooks

* docs: document new init and uninstall hooks interface

* README: update new hook interface spec
8 years ago
Derek Willian Stavis 17de8c4b6b list: refactor code, fix fish 2.3.0 globs (#325) 8 years ago
Luís Fiolhais 15e9af84b1 Search Function (#314)
Add new search command
8 years ago
Sheldon Els 355b519c1e describe all packages works again 8 years ago
Sheldon Els f7e1561067 indent correct on help for describe command 8 years ago
Andrew Rynhard 1853f30dd6 Use local variables 8 years ago
Andrew Rynhard a5654cfec3 Use -L instead of -h 8 years ago
Andrew Rynhard 9b3a2586f2 Fix #303 8 years ago
Itzik Ephraim 0fc99b38b4 bugfix: Core update reported failure when up-to-date 8 years ago
Itzik Ephraim 720c499e61 Report up-to-date packages as such 8 years ago
Itzik Ephraim f6b9bdd941 When pulling a repo, fetch first, to check for updates 8 years ago
Derek Stavis a716badfd4 Implement safe shell reloading inside omf plugin
This commit adds an improved reload code for Oh My Fish, besides
saving the history now the reloading technique keeps directory
history and stack and clears fish_greeting, for a transparent
transition.

The reloading code is now safe regarding to background jobs. exec
wipes fish job control, so the user-facing code under the (just-
introduced by this commit) `omf reload` command is kept safe by a
warning. For testing purposes, `omf update` and `omf remove` rolls
automatic refresh only when `OMF_AUTO_RELOAD` variable is set.

Recap of the commit:
- Add improved reload code (omf.reload)
- Add a safe reload code (omf.cli.reload)
- Add `omf reload` command
- Add opt-in reload to `omf update` and `omf remove` commands
8 years ago
Itzik Ephraim 5764f0d9a4 `omf doctor` checks for fish & git versions
Minimum fish version: 2.2.0
Minimum git version: 1.9.5
8 years ago
Justin Hileman b490fad367 Merge branch 'master' into deprecate-refresh 8 years ago
Derek Stavis 65dfadfc02 lib: deprecate `available` function
This PR officially marks available as deprecated, moving the
deprecated functionality to omf plugin compat quarantine directory.
8 years ago
Derek Stavis 37705618b2 lib: deprecate `refresh` function
With great power comes great responsibility. This function is
somewhat low level, and is harmful to shell's user, as it
completely screws up with job control (subprocesses).

This PR officially marks `refresh` as deprecated, moving the
deprecated functionality to omf plugin `compat` quarantine
directory.
8 years ago
Itzik Ephraim fa24e67633 Allow selective updates 8 years ago
Itzik Ephraim 43ba8b97b7 Improve OMF CLI completions 8 years ago
Derek Stavis 49dda5c2f7 Reorganize `omf` plugin structure
This updates omf plugin to new architecture, moving
functions to `functions` directory. It also revamps the
separation of concerns between CLI and underlying
implementations, organizing them into directories,
whose are autoloaded in plugin startup.
9 years ago
Itzik Ephraim 4dbb1ca57c Support omf- prefix for packages 9 years ago
Bruno Pinto 58daae022b Improve assertion error messages 9 years ago
Bruno Pinto 148ce423ea Report duration of tests
OSX `date` does not support milliseconds output, so @derekstavis created
this `C` code to generate the time with milliseconds.
9 years ago
Bruno Pinto 8fac0ca484 Improve failure reports
Show name of the test that failed with the failure message.
9 years ago
Bruno Pinto 3d1a90e260 Split formatter from test runner 9 years ago
Itzik Ephraim c5670bb9ee 'omf theme' now lists installed and other available themes separately.
Headings are underlined.
Current theme is highlighted in the Installed category.
9 years ago
Bruno Pinto ea4d78ffc3 Basic omf tests 9 years ago
Bruno Pinto e17dc1bfc1 Fish-spec plugin 9 years ago
Derek Stavis acace9039c omf/templates: Align README headers based on omf's 9 years ago
Derek Stavis fa88749da3 install: Implement package dependency installation 9 years ago
Bruno Pinto f57ef1b4b5 Suppress basename usage output
When using basename without any arguments, a usage helper as following
is displayed:

```
usage: basename string [suffix]
       basename [-a] [-s suffix] string [...]
```

When listing the installed packages, if no theme was installed (e.g.
first installation), the `themes/` folder are empty and the usage helper
is displayed. This change addresses it by suppressing the message.
9 years ago
Derek Stavis 3fb8b3484b cli: fix #161 by inverting test argument order
Since `test` interprets arguments starting with a single dash as
options when comparing `test -h = --help` just swap parameter
orders as in `test --help = -h`. Also related to issue #161 is the
issue from fish repository at fish-shell/fish-shell#2332
9 years ago
Derek Stavis 00189cc6bf Fix more wrong basename usage cases 9 years ago
Derek Stavis bc5e434b76 packages.list: Use basename -a with multiple paths 9 years ago
Derek Stavis a1db5d5240 omf.repo.pull: Don't repeat yourself treatment 9 years ago
Derek Stavis 8db6b24966 omf.repo.pull: Simplify stashed flag using set -q 9 years ago
Derek Stavis bdfc248452 omf/templates: Remove Travis from scaffolding 9 years ago
Derek Stavis d224e01570 omf.bundle.install: Fix #123 by rewriting the code
Rewrites the code, as now `omf.install` is type
agnostic, and any -- preceded parameter will
be interpreted as package name.
9 years ago
Derek Stavis c4bd4ade55 omf: Refresh after bundle install 9 years ago
Pablo Santiago Blum de Aguiar 2ac04c7e5e omf.packages.list: list no “builtin” packages 9 years ago
Derek Stavis ccd704bca0 omf.theme: Validate if theme is installed 9 years ago
Derek Stavis 7ccdada8c6 omf install: Don't refresh when nothing installed 9 years ago
Bruno Pinto e234aab3c6 Remove .git$ from name when installing from URL
Support `omf install https://github.com/oh-my-fish/plugin-jump.git`
9 years ago
Bruno Pinto cc7b321268 Create `omf.update` function
Update and install were one thing before.
9 years ago
Bruno Pinto c346731743 Simplify install command
- Install does not do update.
- Share code when installing from URL or name.
9 years ago
Derek Stavis 67c07cb6f6 Fixes a regression in update process added in #115
As #115 migrated list functions, after updating Oh My Fish code
the omf.list_installed_packages gets removed, but is still being
used by the update code.

This commit fixes it by providing a wrapper function.
9 years ago
Bruno Pinto 870efd0dda Merge all omf list functions 9 years ago
Bruno Pinto 7025525ef1 Simplify `omf cd` code
This also namespace the function to `omf.packages`.
9 years ago
nwykes ffa6338664 update some cli completions: remove query and version. add doctor 9 years ago
Derek Stavis ea0b464f1d omf.theme: Rework theme activation code
- Move theme installation to cli entry point (omf.fish)
- Generalize XDG_CONFIG_HOME code in `omf.xdg.config_home`
- Generalize prompt conflicts check in `omf.checks.fish_prompt`
  * Migrate `omf.doctor` to use it

+ Change theme activation steps
  - Create user function path if not existent
  - Check for conflicts in fish_prompt, aborts if found
  - Remove current theme from autoloading paths
  - Add target theme to autoloading paths
  - Link target theme's fish_prompt to user's
  - Persist selected theme to $OMF_CONFIG/theme

This approach brings two major advantages:

- Theme prompt now shows accordingly in fish_config web interface
- Faster theme changes, reducing it from seconds to some milis
- Avoids calling refresh, which makes users much more happy
9 years ago
Derek Stavis a99e3ce86a omf.install: Fix success/error return codes
Return 0 when package installs, != 0 on error
9 years ago
Derek Stavis 291d0c9784 bundle.add: fix theme being persisted twice
`omf theme` was persisting the installed theme twice, one time on
`omf.install` and other time on `omf.bundle.add`.
9 years ago
Derek Stavis 05f3be01be destroy: Revert fish_prompt backup when found
Works toward generalizing the backup restoration logic using a
function, then restoring both config.fish and fish_prompt.
9 years ago
Bruno Pinto 653f173971 Forgot to suppress error message 9 years ago
Bruno Pinto 1ab8a20b8c Fix #8: Fishy plugin template 9 years ago
Bruno Pinto 520d597947 Source `uninstall.fish` file before emitting event
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.
9 years ago
Bruno Pinto bc0d4847e8 Resolve #30: omf doctor command
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.
9 years ago
Bruno Pinto cf8a24deed Only emit uninstall_* event on `omf destroy`
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"`.
9 years ago
Bruno Pinto 46e4d036ba Organize commands and remove undocumented aliases 9 years ago
Bruno Pinto 319c8a05cd Don't overwrite function on test environment
Instead of overwriting functions that use `exec fish` on test
environment, skip this call if the variable `CI` has been defined on the
running shell.
9 years ago
Bruno Pinto e2a7f7d229 Split into init.fish and omf.fish files 9 years ago
Bruno Pinto 9cc8ee5a82 Stash does not support --git-dir
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.
9 years ago
jeremiejig 56b1d837e0 changing to git -C to git --git-dir work-tree 9 years ago
jeremiejig 5cdde2639a bin/install & omf.repo.pull adding -C $git_dir removing pushd and popd 9 years ago
jeremiejig 773f1010b9 omf.destroy: find the most recent backup of config.
using XDG_CONFIG_HOME
9 years ago
jeremiejig b9c1bd9576 Fixing how omf remove work, and omf.remove_package
destroy was broken because of a premature refresh. (giving false hang
behaviour)
9 years ago
jeremiejig 8d1b4dc897 Using raw `name_or_url` instead of `name`. 9 years ago
Derek Stavis de9955e025 omf.bundle.install: sort the bundle after install 9 years ago
Derek Stavis d3ace4fd81 omf.bundle.install: replace `uniq` by `sort -u` 9 years ago
Derek Stavis 56bc40bde9 omf.bundle.remove: return 0 when done 9 years ago
Derek Stavis b20f8dd141 omf.bundle.remove: replace `uniq` by `sort -u` 9 years ago
Derek Stavis 00e3d3e058 omf.bundle.add: sort the bundle after adding entry 9 years ago
Derek Stavis a71bc714f4 completions: use standard fish functions for subcommands 9 years ago
Derek Stavis c929fa41ab bundle: move related functions to omf.bundle namespace 9 years ago
Bruno Pinto 61f71f3ce8 Replace `omf.update` with `omf.repo.pull`
- Pull repository from origin unless upstream exist.
9 years ago
Bruno Pinto 890104ab2e Extract git clone calls into `omf.repo.clone` 9 years ago
Bruno Pinto af49d6f1c2 Replace `omf.util_sync` with `omf.repo.pull`
Based on
https://github.com/Homebrew/homebrew/blob/master/Library/Homebrew/cmd/update.rb#L175-L221
9 years ago
Bruno Pinto 2a0e5ba7cc Remove unused `util_fork_repo` function. 9 years ago
Bruno Pinto 033d976dee Extract _write_bundle to omf.persist
- Add support for persisting theme information.
- Use documented private function naming scheme.
9 years ago
Bruno 75594ea4e2 Merge pull request #20 from scorphus/typos
Fix a typo: succesfully => successfully
9 years ago
Pablo Santiago Blum de Aguiar 59491926af Fix a typo: succesfully => successfully 9 years ago
Bruno Pinto 905f6afa73 Remove pkg-/theme- from folder name
When installing packages (plugins) or themes using a URL, we should
strip the plugin-/pkg-/theme- from the repository name if it exists.
9 years ago
Bruno Pinto b36bc03eb0 Remove global OSTYPE variable. 9 years ago
Bruno Pinto ae0e4388b6 Back to oh-my-fish organization 9 years ago
Bruno Pinto 7dad917436 Make `default` theme the default theme for omf.
* On clean install, configure and download `default` theme.
* Do not allow `default` theme to be removed.
* When the current theme is removed, fallback to `default`.
9 years ago
Derek Stavis a76485be4f omf.help: update install command usage 9 years ago
Derek Stavis 0a195572a1 omf: install without arguments installs bundle 9 years ago
Derek Stavis c6df5feba5 omf.remove_package: also remove from bundle 9 years ago
Derek Stavis 2535892c87 omf.install: insert installed packages into bundle 9 years ago
Derek Stavis e8dcbb507b omf: add install_bundle function 9 years ago
Bruno 98870e8720 Merge pull request #574 from sheldon/describe-without-ruby
describe without ruby
9 years ago