File size: 901 Bytes
08fa61a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/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."