[+] Create one key install script

This commit is contained in:
Hykilpikonna
2021-09-18 11:37:53 -04:00
committed by GitHub
parent f70f597077
commit 802ae61663
+20
View File
@@ -0,0 +1,20 @@
# Go to home directory
pushd $HOME
# Clone repo
git clone "https://github.com/hykilpikonna/zshrc"
# Addline function: add a line to a file if the line doesn't already exist
addline() {
grep -qxF "$2" "$1" || echo "$2" >> $1
}
# Add lines
addline .zshrc 'SCR="$HOME/zshrc/scripts"'
addline .zshrc '. $SCR/zshrc.sh'
# Source file
. .zshrc
# Return to the previous directory
popd