add install scripts
This commit is contained in:
parent
a89828178d
commit
c51cdb0c4d
2 changed files with 46 additions and 0 deletions
23
install.bash
Executable file
23
install.bash
Executable file
|
|
@ -0,0 +1,23 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# Adds $1 to ~/.bashrc if not already present
|
||||||
|
function _add_to_config {
|
||||||
|
if ! grep "$1" ~/.bashrc > /dev/null; then
|
||||||
|
echo "$1" >> ~/.bashrc
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Link files
|
||||||
|
basedir="$(dirname "$(realpath "$0")")"
|
||||||
|
mkdir -p ~/.local/bin
|
||||||
|
ln -frs "${basedir}/gis" ~/.local/bin/gis
|
||||||
|
echo "Created link '~/.local/bin/gis'"
|
||||||
|
|
||||||
|
# Modify bashrc
|
||||||
|
touch ~/.bashrc
|
||||||
|
_add_to_config "export PATH=\$PATH:/home/${USER}/.local/bin"
|
||||||
|
echo "Updated '~/.bashrc'"
|
||||||
|
|
||||||
|
echo
|
||||||
|
echo "Source ~/.bashrc to use gis"
|
||||||
|
echo "To update gis in future execute 'git pull' in '${basedir}'"
|
||||||
23
install.zsh
Executable file
23
install.zsh
Executable file
|
|
@ -0,0 +1,23 @@
|
||||||
|
#!/usr/bin/env zsh
|
||||||
|
|
||||||
|
# Adds $1 to ~/.zshrc if not already present
|
||||||
|
function _add_to_config {
|
||||||
|
if ! grep "$1" ~/.zshrv > /dev/null; then
|
||||||
|
echo "$1" >> ~/.zshrc
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Link files
|
||||||
|
basedir="$(dirname "$(realpath "$0")")"
|
||||||
|
mkdir -p ~/.local/{bin,share/bash-completion/completions}
|
||||||
|
ln -frs "${basedir}/gis" ~/.local/bin/gis
|
||||||
|
echo "Created link '~/.local/bin/gis'"
|
||||||
|
|
||||||
|
# Modify config
|
||||||
|
touch ~/.zshrc
|
||||||
|
_add_to_config "export PATH=\$PATH:/home/${USER}/.local/bin"
|
||||||
|
echo "Updated '~/.zshrc'"
|
||||||
|
|
||||||
|
echo
|
||||||
|
echo "Source ~/.zshrc to use gis"
|
||||||
|
echo "To update gis in future execute 'git pull' in '${basedir}'"
|
||||||
Loading…
Add table
Add a link
Reference in a new issue