update_path
This commit is contained in:
@@ -8,6 +8,10 @@ One command and your terminal learns what you type next.
|
||||
## Install
|
||||
|
||||
```bash
|
||||
# On Ubuntu/Debian, first ensure python3-venv is installed
|
||||
sudo apt-get install python3-venv
|
||||
|
||||
# Then run the installer
|
||||
curl -sSL https://git.appmodel.nl/tour/finish/raw/branch/main/docs/install.sh | bash
|
||||
source ~/.bashrc # or ~/.zshrc
|
||||
```
|
||||
|
||||
@@ -110,7 +110,7 @@ main() {
|
||||
|
||||
echo "Detected shell: $SHELL_TYPE"
|
||||
|
||||
# Check Python
|
||||
# Check Python and venv
|
||||
echo "Checking Python installation..."
|
||||
if ! command -v python3 > /dev/null 2>&1; then
|
||||
echo_error "Python 3 is required but not found"
|
||||
@@ -120,6 +120,17 @@ main() {
|
||||
exit 1
|
||||
fi
|
||||
echo_green "✓ Python 3 found: $(python3 --version)"
|
||||
|
||||
# Check if venv module is available
|
||||
if ! python3 -m venv --help > /dev/null 2>&1; then
|
||||
echo_error "python3-venv module is not installed"
|
||||
echo "Install it with:"
|
||||
echo " Ubuntu/Debian: sudo apt-get install python3-venv"
|
||||
echo " CentOS/RHEL: sudo yum install python3-venv"
|
||||
echo " macOS: (included with python3)"
|
||||
exit 1
|
||||
fi
|
||||
echo_green "✓ python3-venv available"
|
||||
echo ""
|
||||
|
||||
# Check dependencies
|
||||
@@ -178,14 +189,30 @@ main() {
|
||||
# Create virtualenv and install dependencies
|
||||
echo "Creating virtual environment..."
|
||||
VENV_PATH="$HOME/.venvs/finish"
|
||||
if [ ! -d "$VENV_PATH" ]; then
|
||||
python3 -m venv "$VENV_PATH"
|
||||
if [ -d "$VENV_PATH" ]; then
|
||||
echo "Virtual environment already exists, removing old one..."
|
||||
rm -rf "$VENV_PATH"
|
||||
fi
|
||||
|
||||
if ! python3 -m venv "$VENV_PATH"; then
|
||||
echo_error "Failed to create virtual environment"
|
||||
echo "Make sure python3-venv is installed:"
|
||||
echo " Ubuntu/Debian: sudo apt-get install python3-venv"
|
||||
exit 1
|
||||
fi
|
||||
echo_green "✓ Virtual environment created at $VENV_PATH"
|
||||
|
||||
echo "Installing Python dependencies..."
|
||||
"$VENV_PATH/bin/pip" install --quiet --upgrade pip
|
||||
"$VENV_PATH/bin/pip" install --quiet -r "$TEMP_REQ"
|
||||
if ! "$VENV_PATH/bin/pip" install --quiet --upgrade pip; then
|
||||
echo_error "Failed to upgrade pip"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! "$VENV_PATH/bin/pip" install --quiet -r "$TEMP_REQ"; then
|
||||
echo_error "Failed to install dependencies"
|
||||
cat "$TEMP_REQ"
|
||||
exit 1
|
||||
fi
|
||||
echo_green "✓ Dependencies installed"
|
||||
rm -f "$TEMP_REQ"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user