From 5e116058c823dc823bdb5fbd3ca53f938884471f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82uszak?= Date: Mon, 28 Feb 2022 10:35:38 +0100 Subject: [PATCH] [change] improve the install.sh script (#167) --- install.sh | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/install.sh b/install.sh index 48c87973e..989795143 100755 --- a/install.sh +++ b/install.sh @@ -1,7 +1,8 @@ #!/usr/bin/env bash # script for building and running bazel bsp server locally -# script takes parameter with path to different project (as default this project) +# it takes a single parameter with the path to project which you want to import with bsp +# (by default it "installs" the bsp server in the current directory) project_path=${1:-$PWD} @@ -12,12 +13,19 @@ bsp_path="$(bazel info bazel-bin)/server/src/main/java/org/jetbrains/bsp/bazel/b echo -e "============================" echo -e "Building done." -echo -e "\nInstalling server at '$project_path' ..." +echo -e "\nInstalling server in '$project_path' ..." cd "$project_path" || { echo "cd $project_path failed! EXITING"; exit 155; } -rm -r .bsp/ -rm -r .bazelbsp/ +rm -rf .bsp/ +rm -rf .bazelbsp/ $bsp_path +exit_code=$? + +if [ $exit_code -eq 0 ]; then + echo -e "Done! Enjoy Bazel BSP!" +else + echo -e "Installation failed!" + exit $exit_code +fi -echo -e "\nDone! Enjoy Bazel BSP!"