-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathinstall.sh
More file actions
27 lines (22 loc) · 1.03 KB
/
install.sh
File metadata and controls
27 lines (22 loc) · 1.03 KB
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
#!/bin/sh
#could be part of server-package postinst
mkdir -p ~/.local/lib/opsicli
mkdir -p ~/.local/lib/opsicli/shell-complete
if bash --version > /dev/null 2> /dev/null; then
_OPSI_COMPLETE=source_bash dist/opsi > ~/.local/lib/opsicli/shell-complete/opsi-complete-bash.sh
if ! grep -q "opsicli/shell-complete/opsi-complete-bash.sh" ~/.bashrc; then
echo "adding opsi-complete-bash.sh to .bashrc"
echo "source ~/.local/lib/opsicli/shell-complete/opsi-complete-bash.sh" >> ~/.bashrc
fi
fi
if zsh --version > /dev/null 2> /dev/null; then
_OPSI_COMPLETE=source_zsh dist/opsi > ~/.local/lib/opsicli/shell-complete/opsi-complete-zsh.sh
if ! grep -q "opsicli/shell-complete/opsi-complete-zsh.sh" ~/.bashrc; then
echo "adding opsi-complete-zsh.sh to .zshrc"
echo "source ~/.local/lib/opsicli/shell-complete/opsi-complete-zsh.sh" >> ~/.zshrc
fi
fi
if fish --version > /dev/null 2> /dev/null; then
echo "adding opsi-complete.sh to ~/.config/fish/completions/"
_OPSI_COMPLETE=source_fish dist/opsi > ~/.config/fish/completions/opsi-complete.fish
fi