|
#!/bin/bash |
|
|
|
|
|
skip_installation=false |
|
args=() |
|
|
|
for arg in "$@"; do |
|
if [ "$arg" == "--skip" ]; then |
|
skip_installation=true |
|
else |
|
args+=("$arg") |
|
fi |
|
done |
|
|
|
|
|
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 |
|
|
|
|
|
if [ ${#args[@]} -ne 0 ]; then |
|
echo "Installing additional packages: ${args[*]}" |
|
pip install "${args[@]}" |
|
fi |
|
|
|
|
|
echo "Updating requirements.txt..." |
|
pip freeze > requirements.txt |
|
|
|
echo "Done." |
|
|