forked from danhper/fundle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install-fundle-global.fish
32 lines (25 loc) · 1.38 KB
/
install-fundle-global.fish
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
builtin echo "[Downloading fundle ...]";
command sudo -v
builtin set -l test $status
builtin printf 'You are %sa sudoer!' (builtin test $test -eq 0
or builtin printf 'not ')
if builtin $test -eq 0
command sudo mkdir -p /root/.config/fish/functions /root/.config/fish/completions
command sudo chmod a+r -R /root/.config/fish
command sudo grep fundle.fish /root/.config/fish/config.fish
or command echo "builtin source /root/.config/fish/functions/fundle.fish" | sudo tee -a /root/.config/fish/config.fish > /dev/null
command echo "for f in (command find /etc/fish -type l -name '*.fish' -printf '%d %p\n' | command sort | command cut -d' ' -f2-)\n builtin source (command readlink -f \"$f\")\nend" | sudo tee -a /etc/fish/config.fish > /dev/null
for i in functions completions
command sudo mkdir -p /root/.config/fish/$i
command sudo curl -sfL https://raw.githubusercontent.com/tuvistavie/fundle/master/$i/fundle.fish > /root/.config/fish/$i/fundle.fish;
end
builtin argparse 'r-restrict_user_plugins' -- $argv
builtin set -q _flag_restrict_user_plugins
or for i in functions completions
command sudo ln -v /root/.config/fish/$i/fundle.fish /etc/fish/$i/
and command sudo chmod -c a+rx /root/.config/$i/fundle.fish
end
command sudo --user=root fish -c "fundle install";
and builtin exec fish;
# leave the semicolons at the end of the lines, they are needed by eval
end