From 14006e1aceeba8b0328bab231c930e52a83de496 Mon Sep 17 00:00:00 2001 From: nthnn Date: Tue, 19 Dec 2023 02:35:04 +0800 Subject: [PATCH] Updated installation Bash script. --- support/install.sh | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/support/install.sh b/support/install.sh index 5eb7bf1..bcf143c 100755 --- a/support/install.sh +++ b/support/install.sh @@ -1,6 +1,11 @@ -git clone https://github.com/nthnn/Qrepo.git -cd Qrepo -chmod -R 777 build.sh -./build.sh -mv dist/qrepo /usr/local/bin/qrepo -rm -rf ../Qrepo \ No newline at end of file +if [ "$(uname)" == "Darwin" ]; then + (brew list golang || brew install golang) > /dev/null 2>&1 + (brew list git || brew install git) > /dev/null 2>&1 +elif [ "$(uname)" == "Linux" ]; then + sudo apt-get -y install golang > /dev/null 2>&1 + sudo apt-get -y install git > /dev/null 2>&1 +fi + +git clone --quiet --depth 1 https://github.com/nthnn/Qrepo.git && cd Qrepo +chmod -R 777 build.sh && ./build.sh +rm -i /usr/local/bin/qrepo && mv dist/qrepo /usr/local/bin/qrepo && rm -rf ../Qrepo \ No newline at end of file