Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure global installation #62

Open
wants to merge 56 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
5ca1c2d
Installation script
hunter-richardson Oct 27, 2022
6b2e060
Dont source fundle twice
hunter-richardson Oct 27, 2022
ae261f8
Use tabs
hunter-richardson Oct 27, 2022
63ae98d
Configure /etc/fish/config.fish
hunter-richardson Oct 27, 2022
e612450
Global plugins functions
hunter-richardson Oct 28, 2022
68508b6
Add global plugin completions
hunter-richardson Oct 28, 2022
9bef83b
Correct typo
hunter-richardson Oct 28, 2022
ec4b995
Use builtin/command to avoid user overrides
hunter-richardson Oct 28, 2022
709f8a5
Use builtin/command to avoid user overrides
hunter-richardson Oct 28, 2022
cb9afad
Favor printf to (more expensive) echo
hunter-richardson Oct 28, 2022
90dc2cd
Rewrite __fundle_plugins
hunter-richardson Oct 28, 2022
6a17d0c
Optimize fundle code
hunter-richardson Oct 28, 2022
a9e6a6b
Favor printf to (more expensive) echo
hunter-richardson Oct 28, 2022
55af116
Avoid test ! where possible
hunter-richardson Oct 28, 2022
d3d797a
Optimize fundle code
hunter-richardson Oct 28, 2022
9f29955
Update README
hunter-richardson Oct 28, 2022
3b774fe
Update README
hunter-richardson Oct 28, 2022
63b376b
Update README
hunter-richardson Oct 28, 2022
4443984
Update README for readability
hunter-richardson Oct 28, 2022
b0ea23f
Update README
hunter-richardson Oct 28, 2022
61bd6b9
Update README
hunter-richardson Oct 28, 2022
b59df31
Update completion
hunter-richardson Oct 28, 2022
e0a3054
Correct typo
hunter-richardson Oct 28, 2022
291368b
Update __fundle_global_plugin
hunter-richardson Oct 28, 2022
3f6b59d
Update README
hunter-richardson Oct 28, 2022
74e52af
Update README
hunter-richardson Oct 28, 2022
3a67bcb
Update "fundle list" to include global plugins
hunter-richardson Oct 28, 2022
fc6ba85
Update README
hunter-richardson Oct 28, 2022
fa2862d
Optimize local installation script
hunter-richardson Oct 28, 2022
ffbc1b2
Update README
hunter-richardson Oct 28, 2022
1f5171e
Update README
hunter-richardson Oct 28, 2022
401f8d4
Handle global-plugin versions
hunter-richardson Oct 28, 2022
eb046f2
Use awk instead of multiple calls to string
hunter-richardson Oct 28, 2022
cb70aba
Correct typo
hunter-richardson Oct 28, 2022
11a282a
Update completions
hunter-richardson Oct 28, 2022
4df4aa6
Update README
hunter-richardson Oct 28, 2022
81ca7e1
Use buitlin/command to avoid user overrides
hunter-richardson Oct 28, 2022
3dd7e41
Correct typos
hunter-richardson Oct 28, 2022
ce433bb
Correct error in __fundle_global_plugin
hunter-richardson Oct 28, 2022
5b2f28e
Update global installation script
hunter-richardson Oct 31, 2022
39d874e
Update global-fundle functionality
hunter-richardson Oct 31, 2022
110120a
Update __fundle_init
hunter-richardson Oct 31, 2022
150063e
Update __fundle_plugin
hunter-richardson Oct 31, 2022
e8ed152
Update 'fundle list' method
hunter-richardson Oct 31, 2022
8566cf1
Update __fundle_list references
hunter-richardson Oct 31, 2022
7f496ab
Remove unused function
hunter-richardson Oct 31, 2022
131d79c
Update 'fundle list' references
hunter-richardson Oct 31, 2022
4c12511
Correct typo
hunter-richardson Oct 31, 2022
823d208
Correct typo
hunter-richardson Oct 31, 2022
6d41e03
Use consistent spacing
hunter-richardson Oct 31, 2022
bf27862
Update README
hunter-richardson Oct 31, 2022
90197aa
Simplify __fundle_global_plugin
hunter-richardson Oct 31, 2022
a2d3e73
Add sudo to additional commands
hunter-richardson Dec 13, 2022
f5349f8
Correct restricted file writing and arg-parsing commands
hunter-richardson Jan 5, 2023
eb93ea9
Restrict to global installation script to sudoers
hunter-richardson Jan 5, 2023
6747704
Remove unnecessary semicolons
hunter-richardson Jan 5, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 38 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,24 @@ the following at the top of your `~/.config/fish/config.fish`.
if not functions -q fundle; eval (curl -sfL https://git.io/fundle-install); end
```

### Global installation

If you want to install fundle globally, simply log in as a sudoer and:

```fish
curl -sfL https://raw.githubusercontent.com/danhper/fundle/master/install-fundle-global.fish | fish
```

### Prevent user installations

If you want to install fundle globally and prevent non-sudoers from installing local plugins, log in as a sudoer and:

```fish
wget https://raw.githubusercontent.com/danhper/fundle/master/install-fundle-global.fish
fish -c "source ./install-fundle-global.fish --restrict-user-plugins"
rm -rf ./install-fundle-plugins.fish # don't forget to delete the downloaded script after the new shell loads
```

### ArchLinux

fundle is available on the AUR, so you can install it system wide with
Expand Down Expand Up @@ -65,7 +83,7 @@ fundle init

This will source the four plugins listed and load all the functions and completions found.

*Note that the `fundle init` is required on each file loading a plugin, so if you load plugins in multiple .fish files, you have to add `fundle init` to each one of them.*
*Note that the `fundle init` is required on each file loading a plugin, so if you load plugins in multiple `.fish` files, you have to add `fundle init` to each one of them.*

After editing `config.fish`:

Expand Down Expand Up @@ -157,15 +175,31 @@ fundle update

to update the plugins.

### Global plugins
If you used the [global installation script](./install-fundle-global.fish) above, then your system is configured for all users to use fundle plugins! (Otherwise, you can't use this funcitonality.)

This means you can `fundle global-plugin 'repo_owner/repo_name'` to load plugins to `/etc/fish`, where they are accessible to everyone.

`fundle global-plugin` simply invokes `fundle plugin` as `root`, so it has the same paramter functionality: `--url` and `--path`.

Unlike the `fundle plugin` command, there's no need to run this at startup in a `.fish` file, or to run `fundle init`/`fundle install` afterwards.
Users need only `source /etc/fish/config.fish` to load newly-installed plugins.

## Commands

* `fundle init`: Initialize fundle, loading all the available plugins
* `fundle install`: Install all plugins
* `fundle update`: Update all plugins (deprecates: `fundle install -u`)
* `fundle plugin PLUGIN [--url PLUGIN_URL] [--path PATH]`: Add a plugin to fundle.
* `fundle update`: Update all local plugins (deprecates: `fundle install -u`)
* `fundle update PLUGIN`: Update a specified local plugin
* `fundle global-update`: Update all global plugins
* `fundle global-update PLUGIN`: Update a specified global plugin
* `fundle plugin PLUGIN [--url PLUGIN_URL] [--path PATH]`: Locally add a plugin to fundle.
* `--url` set the URL to clone the plugin.
* `--path` set the plugin path (relative to the repository root)
* `fundle global-plugin PLUGIN [--url PLUGIN_URL] [--path PATH]`: Globally add a plugin to fundle.
* `--url` set the URL to clone the plugin.
* `--path` set the plugin path (relative to the repository root)
* `fundle list [-s]`: List the currently installed plugins, including dependencies (-s gives a shorter version)
* `fundle list [-s]`: List the currently installed plugins, globally or locally, including dependencies
* `fundle clean`: Cleans unused plugins
* `fundle self-update`: Updates fundle to the latest version
* `fundle version`: Displays the current version of fundle
Expand Down
31 changes: 15 additions & 16 deletions completions/fundle.fish
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
complete -f -c fundle -n '__fish_prog_needs_command' -a init -d "load all plugins"
complete -f -c fundle -n '__fish_prog_needs_command' -a plugin -d "add a plugin"
complete -f -c fundle -n '__fish_prog_needs_command' -a list -d "list plugins"
complete -f -c fundle -n '__fish_prog_needs_command' -a install -d "install all plugins"
complete -f -c fundle -n '__fish_prog_needs_command' -a update -d "update existing plugins"
complete -f -c fundle -n '__fish_prog_needs_command' -a clean -d "cleans unused plugins"
complete -f -c fundle -n '__fish_prog_needs_command' -a self-update -d "update fundle"
complete -f -c fundle -n '__fish_prog_needs_command' -a version -d "display fundle version"
complete -f -c fundle -n '__fish_prog_needs_command' -a help -d "display helps"
builtin complete -f -c fundle -n '__fish_prog_needs_command' -a init -d "load all plugins"
builtin complete -f -c fundle -n '__fish_prog_needs_command' -a global-plugin -d "add a global plugin"
builtin complete -f -c fundle -n '__fish_prog_needs_command' -a plugin -d "add a local plugin"
builtin complete -f -c fundle -n '__fish_prog_needs_command' -a list -d "list plugins"
builtin complete -f -c fundle -n '__fish_prog_needs_command' -a install -d "install all plugins"
builtin complete -f -c fundle -n '__fish_prog_needs_command' -a global-update -d "update existing global plugin(s)"
builtin complete -f -c fundle -n '__fish_prog_needs_command' -a update -d "update existing local plugin(s)"
builtin complete -f -c fundle -n '__fish_prog_needs_command' -a clean -d "cleans unused plugins"
builtin complete -f -c fundle -n '__fish_prog_needs_command' -a self-update -d "update fundle"
builtin complete -f -c fundle -n '__fish_prog_needs_command' -a version -d "display fundle version"
builtin complete -f -c fundle -n '__fish_prog_needs_command' -a help -d "display helps"

complete -f -c fundle -n '__fish_prog_using_command install' -s u -l update -d "update existing plugins (deprecated)"
builtin complete -f -c fundle -n '__fish_prog_using_command global-plugin' -l url -d "set the plugin URL"
builtin complete -f -c fundle -n '__fish_prog_using_command global-plugin' -l path -d "set the plugin load path"

complete -f -c fundle -n '__fish_prog_using_command list' -s s -l short -d "show a short list with plugin names only"

complete -f -c fundle -n '__fish_prog_using_command init' -s p -l profile -d "profile time for loading each plugin"

complete -f -c fundle -n '__fish_prog_using_command plugin' -l url -d "set the plugin URL"
complete -f -c fundle -n '__fish_prog_using_command plugin' -l path -d "set the plugin load path"
builtin complete -f -c fundle -n '__fish_prog_using_command plugin' -l url -d "set the plugin URL"
builtin complete -f -c fundle -n '__fish_prog_using_command plugin' -l path -d "set the plugin load path"
Loading