Skip to content

Commit

Permalink
[change] improve the install.sh script (#167)
Browse files Browse the repository at this point in the history
  • Loading branch information
agluszak committed Feb 28, 2022
1 parent e6062ca commit 5e11605
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions install.sh
Original file line number Diff line number Diff line change
@@ -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}

Expand All @@ -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!"

0 comments on commit 5e11605

Please sign in to comment.