From 802ae6166367508bc51995df3ec0abb38772196c Mon Sep 17 00:00:00 2001 From: Hykilpikonna Date: Sat, 18 Sep 2021 11:37:53 -0400 Subject: [PATCH] [+] Create one key install script --- fastinstall.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 fastinstall.sh diff --git a/fastinstall.sh b/fastinstall.sh new file mode 100644 index 0000000..56617bd --- /dev/null +++ b/fastinstall.sh @@ -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