From 802ae6166367508bc51995df3ec0abb38772196c Mon Sep 17 00:00:00 2001 From: Hykilpikonna Date: Sat, 18 Sep 2021 11:37:53 -0400 Subject: [PATCH 1/5] [+] 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 From 649b43972578789b1e96887ae11da91a5697d954 Mon Sep 17 00:00:00 2001 From: Hykilpikonna Date: Sat, 18 Sep 2021 11:38:11 -0400 Subject: [PATCH 2/5] [M] Rename old readme to server-setup.md --- README.md => server-setup.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename README.md => server-setup.md (100%) diff --git a/README.md b/server-setup.md similarity index 100% rename from README.md rename to server-setup.md From 7af11da5d10bd8b1159d67cfb390c29637b6f2fe Mon Sep 17 00:00:00 2001 From: Hykilpikonna Date: Sat, 18 Sep 2021 11:39:03 -0400 Subject: [PATCH 3/5] [+] Create new readme --- README.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..8ee3b42 --- /dev/null +++ b/README.md @@ -0,0 +1,5 @@ +# zshrc +My zshrc + +## Installation +`/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Hykilpikonna/zshrc/HEAD/fastinstall.sh)"` From f35b31a3bd1b347c89a5be5cc33f59e138367521 Mon Sep 17 00:00:00 2001 From: Hykilpikonna Date: Sat, 18 Sep 2021 11:39:23 -0400 Subject: [PATCH 4/5] [U] Update readme format --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 8ee3b42..c137cb1 100644 --- a/README.md +++ b/README.md @@ -2,4 +2,6 @@ My zshrc ## Installation -`/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Hykilpikonna/zshrc/HEAD/fastinstall.sh)"` +```sh +/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Hykilpikonna/zshrc/HEAD/fastinstall.sh)" +``` From 053c2da6ac6de2f8dd0a755df98987c88d71963b Mon Sep 17 00:00:00 2001 From: Hykilpikonna Date: Sat, 18 Sep 2021 11:40:51 -0400 Subject: [PATCH 5/5] [+] fastinstall: check if already installed --- fastinstall.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/fastinstall.sh b/fastinstall.sh index 56617bd..452f165 100644 --- a/fastinstall.sh +++ b/fastinstall.sh @@ -1,6 +1,12 @@ # Go to home directory pushd $HOME +# Check if already installed +if [ -d "zshrc" ]; then + echo "Already installed." + exit -1 +fi + # Clone repo git clone "https://github.com/hykilpikonna/zshrc"