@@ -8,7 +8,7 @@ if [ -z "$VERSION" ]; then
88fi
99
1010INSTALL_DIR=" $HOME /.library-insight"
11- ZIP_NAME=" library-insight-cli- $VERSION .zip"
11+ ZIP_NAME=" library-insight-$VERSION .zip"
1212RELEASE_URL=" https://github.com/Coding-Meet/Library-Insight/releases/download/v$VERSION /$ZIP_NAME "
1313
1414echo " =================================================="
@@ -30,19 +30,27 @@ if curl -L --fail -o "$TEMP_ZIP" "$RELEASE_URL"; then
3030 unzip -o " $TEMP_ZIP " -d " $INSTALL_DIR /"
3131
3232 # Check if files were extracted into a subdirectory and move them up
33- if [ -d " $INSTALL_DIR /library-insight-cli-$VERSION " ]; then
33+ if [ -d " $INSTALL_DIR /library-insight-$VERSION " ]; then
34+ cp -R " $INSTALL_DIR /library-insight-$VERSION " /* " $INSTALL_DIR /"
35+ rm -rf " $INSTALL_DIR /library-insight-$VERSION "
36+ elif [ -d " $INSTALL_DIR /library-insight-cli-$VERSION " ]; then
3437 cp -R " $INSTALL_DIR /library-insight-cli-$VERSION " /* " $INSTALL_DIR /"
3538 rm -rf " $INSTALL_DIR /library-insight-cli-$VERSION "
3639 fi
3740 rm -f " $TEMP_ZIP "
3841 echo " Pre-compiled release installed successfully!"
3942else
4043 echo " --------------------------------------------------"
41- echo " Note: Release download failed (e.g. tag not pushed yet)."
42- echo " Falling back to compiling from local source code..."
44+ echo " Note: Release zip download failed."
4345 echo " --------------------------------------------------"
44- ./gradlew :library-insight-cli:installDist
45- cp -R library-insight-cli/build/install/library-insight/* " $INSTALL_DIR /"
46+ if [ -f " ./gradlew" ]; then
47+ echo " Falling back to compiling from local source code..."
48+ ./gradlew :library-insight-cli:installDist
49+ cp -R library-insight-cli/build/install/library-insight/* " $INSTALL_DIR /"
50+ else
51+ echo " ERROR: Could not download pre-compiled release and no local gradlew wrapper found."
52+ exit 1
53+ fi
4654fi
4755
4856echo " Configuring executable permissions..."
0 commit comments