@@ -57,17 +57,27 @@ echo "Configuring executable permissions..."
5757chmod +x " $INSTALL_DIR /bin/library-insight"
5858
5959echo " Creating global symlink..."
60+ SYMLINK_SUCCESS=false
6061if [ -d " /usr/local/bin" ]; then
61- echo " Creating symlink in /usr/local/bin/library-insight (may request password for sudo)..."
62- sudo ln -sf " $INSTALL_DIR /bin/library-insight" /usr/local/bin/library-insight
62+ if [ -w " /usr/local/bin" ]; then
63+ ln -sf " $INSTALL_DIR /bin/library-insight" /usr/local/bin/library-insight 2> /dev/null && SYMLINK_SUCCESS=true
64+ else
65+ sudo -n ln -sf " $INSTALL_DIR /bin/library-insight" /usr/local/bin/library-insight 2> /dev/null && SYMLINK_SUCCESS=true || sudo ln -sf " $INSTALL_DIR /bin/library-insight" /usr/local/bin/library-insight 2> /dev/null && SYMLINK_SUCCESS=true || true
66+ fi
67+ fi
68+
69+ if [ " $SYMLINK_SUCCESS " = true ]; then
6370 echo " =================================================="
6471 echo " SUCCESS: Library Insight installed globally!"
6572 echo " You can now run the 'library-insight' command."
6673 echo " =================================================="
6774else
68- echo " WARNING: /usr/local/bin does not exist on your system."
69- echo " Please add the following to your shell configuration (.zshrc or .bashrc):"
70- echo " export PATH=\"\$ PATH:$INSTALL_DIR /bin\" "
75+ echo " =================================================="
76+ echo " SUCCESS: Library Insight installed at $INSTALL_DIR /bin/library-insight!"
77+ echo " Direct path: $HOME /.library-insight/bin/library-insight"
78+ echo " To run directly without full path, add this to your .zshrc / .bashrc:"
79+ echo " export PATH=\"\$ PATH:$INSTALL_DIR /bin\" "
80+ echo " =================================================="
7181fi
7282
7383echo " "
0 commit comments