#!/bin/bash # Check if --skip argument is present skip_installation=false args=() for arg in "$@"; do if [ "$arg" == "--skip" ]; then skip_installation=true else args+=("$arg") fi done # Install packages from requirements.txt if not skipped and file exists if [ "$skip_installation" == false ]; then if [ -f requirements.txt ]; then echo "Installing packages from requirements.txt..." pip install -r requirements.txt else echo "requirements.txt not found. Skipping installation from file." fi else echo "Skipping installation from requirements.txt..." fi # Install additional packages passed as arguments if [ ${#args[@]} -ne 0 ]; then echo "Installing additional packages: ${args[*]}" pip install "${args[@]}" fi # Update requirements.txt echo "Updating requirements.txt..." pip freeze > requirements.txt echo "Done."