[05a195]: / install_lung.sh

Download this file

34 lines (28 with data), 955 Bytes

 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
#!/bin/bash
# Check if platipy is installed
if ! python3 -c "import platipy" &> /dev/null; then
echo "Error: platipy package is not installed"
echo "Please install platipy first using: pip install platipy"
exit 1
fi
# Define the target directory
TARGET_DIR="$HOME/.local/lib/python3.8/site-packages/platipy/imaging/utils"
# Check if the target directory exists
if [ ! -d "$TARGET_DIR" ]; then
echo "Error: Directory $TARGET_DIR does not exist"
exit 1
fi
# Check if lung.py exists in the target directory
if [ -f "$TARGET_DIR/lung.py" ]; then
echo "Backing up existing lung.py to lung-org.py"
mv "$TARGET_DIR/lung.py" "$TARGET_DIR/lung-org.py"
fi
# Copy the local lung.py to the target directory
if [ -f "lung.py" ]; then
echo "Copying new lung.py to $TARGET_DIR"
cp "lung.py" "$TARGET_DIR/"
echo "Installation completed successfully"
else
echo "Error: lung.py not found in current directory"
exit 1
fi