From 5279dc7e6730554ceea84f4e827df1232c43b6c7 Mon Sep 17 00:00:00 2001 From: Martin Blazik Date: Sat, 24 Sep 2022 12:22:49 +0200 Subject: [PATCH] gw installation script install to $GWS/opt/ --- bashrc | 2 ++ scripts/gw-install.sh | 22 +++++++++++++++++----- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/bashrc b/bashrc index 96eaee0..f02db8d 100644 --- a/bashrc +++ b/bashrc @@ -15,4 +15,6 @@ for rc_file in $WORKSPACE/rc/*.sh; do done append_path "$LWS/bin" +append_path "$LWS/opt/bin" set_uniq_path + diff --git a/scripts/gw-install.sh b/scripts/gw-install.sh index 3a889d3..ac615c0 100755 --- a/scripts/gw-install.sh +++ b/scripts/gw-install.sh @@ -2,11 +2,23 @@ # https://github.com/To-da/gdub -set -x set -e +set -u -cd $HOME/src/other -git clone https://github.com/To-da/gdub.git -cd gdub -sudo ./install +readonly REPO="https://github.com/To-da/gdub.git" +readonly GW_PATH="$LWS/opt/gdub" +readonly GW_BIN="$GW_PATH/bin/gw" +readonly OPT_BIN_PATH="$LWS/opt/bin" + +if [[ -f "$OPT_BIN_PATH/gw" ]]; then + echo "gw already installed" + exit 0 +fi +if [[ ! -d "$GW_PATH" ]]; then + git clone "$REPO" "$GW_PATH" +fi +if [[ ! -d "$OPT_BIN_PATH" ]]; then + mkdir "$OPT_BIN_PATH" +fi +cp "$GW_BIN" "$OPT_BIN_PATH/"