Skip to content

Commit 39f6c1a

Browse files
committed
refactor(install): Add PATH check and skip setup in nested install
- Check if ~/.local/bin is on PATH after installation and warn users - Skip setup commands when Linux install.sh is called from main installer - Add Q_SKIP_SETUP environment variable to control setup execution
1 parent 0dbfd71 commit 39f6c1a

File tree

2 files changed

+17
-5
lines changed

2 files changed

+17
-5
lines changed

bundle/linux/install.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,14 +140,18 @@ if [ -n "${Q_INSTALL_GLOBAL:-}" ]; then
140140
install -m 755 "$SCRIPT_DIR/bin/qchat" /usr/local/bin/
141141
install -m 755 "$SCRIPT_DIR/bin/qterm" /usr/local/bin/
142142

143-
/usr/local/bin/q integrations install dotfiles
144-
/usr/local/bin/q setup --global "$@"
143+
if [ -z "${Q_SKIP_SETUP:-}" ]; then
144+
/usr/local/bin/q integrations install dotfiles
145+
/usr/local/bin/q setup --global "$@"
146+
fi
145147
else
146148
mkdir -p "$HOME/.local/bin"
147149

148150
install -m 755 "$SCRIPT_DIR/bin/q" "$HOME/.local/bin/"
149151
install -m 755 "$SCRIPT_DIR/bin/qchat" "$HOME/.local/bin/"
150152
install -m 755 "$SCRIPT_DIR/bin/qterm" "$HOME/.local/bin/"
151153

152-
"$HOME/.local/bin/q" setup "$@"
154+
if [ -z "${Q_SKIP_SETUP:-}" ]; then
155+
"$HOME/.local/bin/q" setup "$@"
156+
fi
153157
fi

scripts/install.sh

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ install_linux() {
383383

384384
log "Running installer..."
385385
chmod +x "$install_script"
386-
"$install_script"
386+
Q_SKIP_SETUP=1 "$install_script"
387387
}
388388

389389
# Cleanup function - only removes files/dirs we created
@@ -465,10 +465,18 @@ main() {
465465
echo
466466
success "$CLI_NAME installation completed successfully!"
467467
echo
468+
469+
# Check if ~/.local/bin is on PATH
470+
if [[ ":$PATH:" != *":$HOME/.local/bin:"* ]]; then
471+
warning "$HOME/.local/bin is not on your PATH"
472+
echo "Add it to your PATH by adding this line to your shell configuration file:"
473+
echo " export PATH=\"\$HOME/.local/bin:\$PATH\""
474+
echo
475+
fi
476+
468477
echo "Next steps:"
469478
echo "1. Run: $COMMAND_NAME --help to get started"
470479
echo "2. Run: $COMMAND_NAME chat to start an interactive session"
471-
echo "3. Run: $COMMAND_NAME integrations install --help to install terminal integrations"
472480
echo
473481
}
474482

0 commit comments

Comments
 (0)