Skip to content

Commit 2fbd89f

Browse files
committed
fix: improve installation UX by suggesting alias instead of modifying user files
- Remove automatic modification of user shell profile files - Suggest manual alias addition with clear instructions - Provide alternative direct execution method - Update both install.sh and setup.sh for consistency
1 parent 5e83b48 commit 2fbd89f

File tree

2 files changed

+22
-48
lines changed

2 files changed

+22
-48
lines changed

install.sh

Lines changed: 11 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -106,30 +106,17 @@ else
106106
fi
107107
fi
108108

109-
# Create alias in ~/.bashrc or ~/.zshrc
110-
SHELL_RC=""
111-
if [ -f "$HOME/.zshrc" ]; then
112-
SHELL_RC="$HOME/.zshrc"
113-
elif [ -f "$HOME/.bashrc" ]; then
114-
SHELL_RC="$HOME/.bashrc"
115-
fi
116-
117-
if [ -n "$SHELL_RC" ]; then
118-
echo "Adding alias to $SHELL_RC..."
119-
120-
# Remove old alias if it exists
121-
sed -i.bak '/alias files-db-mcp=/d' "$SHELL_RC"
122-
123-
# Add new alias
124-
echo "alias files-db-mcp='$INSTALL_DIR/run.sh'" >> "$SHELL_RC"
125-
126-
echo "Alias added. You can now use 'files-db-mcp' command in any project directory."
127-
echo "Please restart your shell or run 'source $SHELL_RC' to use the command."
128-
else
129-
echo "Could not find .zshrc or .bashrc to add alias."
130-
echo "To use Files-DB-MCP, run:"
131-
echo " $INSTALL_DIR/run.sh"
132-
fi
109+
# Suggest how to add alias
110+
echo "To add a convenient alias for Files-DB-MCP, add the following line to your shell profile:"
111+
echo
112+
echo " alias files-db-mcp='$INSTALL_DIR/run.sh'"
113+
echo
114+
echo "For example, in ~/.bashrc, ~/.zshrc, or your preferred shell configuration file."
115+
echo "After adding the alias, run 'source ~/.bashrc' (or your shell config file) to activate it."
116+
echo
117+
echo "Alternatively, you can run Files-DB-MCP directly with:"
118+
echo " $INSTALL_DIR/run.sh"
119+
echo
133120

134121
# Make scripts executable
135122
chmod +x "$INSTALL_DIR/run.sh"

setup.sh

Lines changed: 11 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -39,30 +39,17 @@ fi
3939
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
4040
INSTALL_DIR="$HOME/.files-db-mcp"
4141

42-
# Create alias in ~/.bashrc or ~/.zshrc
43-
SHELL_RC=""
44-
if [ -f "$HOME/.zshrc" ]; then
45-
SHELL_RC="$HOME/.zshrc"
46-
elif [ -f "$HOME/.bashrc" ]; then
47-
SHELL_RC="$HOME/.bashrc"
48-
fi
49-
50-
if [ -n "$SHELL_RC" ]; then
51-
echo "Adding alias to $SHELL_RC..."
52-
53-
# Remove old alias if it exists
54-
sed -i.bak '/alias files-db-mcp=/d' "$SHELL_RC"
55-
56-
# Add new alias
57-
echo "alias files-db-mcp='$SCRIPT_DIR/run.sh'" >> "$SHELL_RC"
58-
59-
echo "Alias added. You can now use 'files-db-mcp' command in any project directory."
60-
echo "Please restart your shell or run 'source $SHELL_RC' to use the command."
61-
else
62-
echo "Could not find .zshrc or .bashrc to add alias."
63-
echo "To use Files-DB-MCP, run:"
64-
echo " $SCRIPT_DIR/run.sh"
65-
fi
42+
# Suggest how to add alias
43+
echo "To add a convenient alias for Files-DB-MCP, add the following line to your shell profile:"
44+
echo
45+
echo " alias files-db-mcp='$SCRIPT_DIR/run.sh'"
46+
echo
47+
echo "For example, in ~/.bashrc, ~/.zshrc, or your preferred shell configuration file."
48+
echo "After adding the alias, run 'source ~/.bashrc' (or your shell config file) to activate it."
49+
echo
50+
echo "Alternatively, you can run Files-DB-MCP directly with:"
51+
echo " $SCRIPT_DIR/run.sh"
52+
echo
6653

6754
# Make scripts executable
6855
chmod +x "$SCRIPT_DIR/run.sh"

0 commit comments

Comments
 (0)