forked from kelmes1/pipboy-pi
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.sh
More file actions
executable file
·49 lines (35 loc) · 1.5 KB
/
Copy pathinit.sh
File metadata and controls
executable file
·49 lines (35 loc) · 1.5 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
39
40
41
42
43
44
45
46
47
#!/bin/bash
SECRET_FILE="modules/settings_secrets.py"
# if current directory is not project root (contains init.sh), exit with error
if [ ! -f init.sh ]; then
echo "Error: init.sh not found. Please run this script from the project root directory."
exit 1
fi
# Build script for modules/cpp using CMake (Linux/macOS version)
# Create build directory if it doesn't exist
mkdir -p modules/cpp/build
# Generate build files
cmake -S modules/cpp -B modules/cpp/build
# Build the project (Release mode)
cmake --build modules/cpp/build --config Release
# Copy built files from Release to modules/cpp (if Release dir exists)
if [ -d modules/cpp/build/Release ]; then
cp modules/cpp/build/Release/* modules/cpp/
fi
# Create settings_secrets.py if it doesn't exist
if [ ! -f $SECRET_FILE ]; then
touch $SECRET_FILE
# create REAL_LOCATION, LONGITUDE, LATITUDE GEOAPIFY_API_KEY variables in settings_secrets.py using user input
echo "Please enter your REAL_LOCATION (e.g., 'New York'):"
read REAL_LOCATION
echo "Please enter your LONGITUDE (e.g., '-74.0060'):"
read LONGITUDE
echo "Please enter your LATITUDE (e.g., '40.7128'):"
read LATITUDE
echo "Please enter your GEOAPIFY_API_KEY (get one for free at https://www.geoapify.com):"
read GEOAPIFY_API_KEY
echo "REAL_LOCATION='$REAL_LOCATION'" >> $SECRET_FILE
echo "LONGITUDE='$LONGITUDE'" >> $SECRET_FILE
echo "LATITUDE='$LATITUDE'" >> $SECRET_FILE
echo "GEOAPIFY_API_KEY='$GEOAPIFY_API_KEY'" >> $SECRET_FILE
fi