The script now copies raspi-blinka.py and temp-calc.py file to temp-sensor folder created in desktop.

This commit is contained in:
K 2024-10-07 00:58:42 +05:30
parent 9db33f4c98
commit b24397000d
Signed by: notkshitij
GPG Key ID: C5B8BC7530F8F43F

View File

@ -64,6 +64,7 @@ PROJECT_DIR="/home/$USER/Desktop/temp-sensor"
if [ ! -d "$PROJECT_DIR" ]; then if [ ! -d "$PROJECT_DIR" ]; then
echo -e "$line\nCreating 'temp-sensor' in Desktop directory for current user.\n$line\n" echo -e "$line\nCreating 'temp-sensor' in Desktop directory for current user.\n$line\n"
mkdir -p "$PROJECT_DIR" mkdir -p "$PROJECT_DIR"
cp "./raspi-blinka.py" "./temp-calc.py" "$PROJECT_DIR/"
echo -e "$line\nCreated '$PROJECT_DIR' directory.\n$line\n" echo -e "$line\nCreated '$PROJECT_DIR' directory.\n$line\n"
else else
echo -e "$line\n$PROJECT_DIR already exists. Please delete the folder before running this script.\n$line\n\nExiting..." echo -e "$line\n$PROJECT_DIR already exists. Please delete the folder before running this script.\n$line\n\nExiting..."
@ -72,6 +73,7 @@ fi
# Create and activate Python virtual environment # Create and activate Python virtual environment
cd "$PROJECT_DIR" cd "$PROJECT_DIR"
chmod ugo+x ./raspi-blinka.py ./temp-calc.py
python3 -m venv . --system-site-packages python3 -m venv . --system-site-packages
echo -e "$line\nVirtual environment created.\n$line\n" echo -e "$line\nVirtual environment created.\n$line\n"
echo -e "$line\nActivating virtual environment...\n$line\n" echo -e "$line\nActivating virtual environment...\n$line\n"