-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstartProject.sh
More file actions
38 lines (30 loc) · 1.04 KB
/
startProject.sh
File metadata and controls
38 lines (30 loc) · 1.04 KB
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
# 1. Define Paths
ELECTRON_DIR="/mnt/c/Users/sebas/OneDrive/Documents/VSCode/AlphaGround"
PYTHON_DIR="/mnt/c/Users/sebas/OneDrive/Documents/VSCode/PySerial"
PYTHON_EXE="$PYTHON_DIR/.alpha/Scripts/python.exe"
PYTHON_SCRIPT="$PYTHON_DIR/logger.py"
# Convert WSL path to Windows path for the Python Executable
PYTHON_SCRIPT_WIN=$(wslpath -w "$PYTHON_SCRIPT")
# 2. Cleanup Setup
# This function kills the background python process when you Ctrl+C the script
cleanup() {
echo "Stopping Logger..."
taskkill.exe /F /IM python.exe > /dev/null 2>&1
exit
}
trap cleanup SIGINT SIGTERM
# 3. Start Python Backend
echo "Starting Virtual Environment & Logger..."
cd "$ELECTRON_DIR" || exit
# Run python in background
"$PYTHON_EXE" "$PYTHON_SCRIPT_WIN" &
PYTHON_PID=$!
# 4. Start Electron Frontend
echo "Starting Electron Application..."
# Using 'cmd.exe /c' is fine, but ensure npm is in your Windows PATH
cmd.exe /c "npm run dev"
# Cleanup after Electron closes
cleanup
#cd /mnt/c/Users/sebas/OneDrive/Documents/VSCode/AlphaGround/
#./startProject.sh