forked from macadmins/sofa
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathentrypoint.sh
29 lines (23 loc) · 867 Bytes
/
entrypoint.sh
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
#!/bin/sh
# Create the directory if it doesn't exist
mkdir -p v1
# Check if at least one argument is provided
if [ "$#" -eq 0 ]; then
echo "Error: No OS types provided."
exit 1
fi
# Loop through all OS types provided as arguments
for OS_TYPE in "$@"; do
echo "Starting: $OS_TYPE"
# Run the main script that generates JSON
python build-sofa-feed.py "$OS_TYPE"
# Wait for a moment to ensure files are written
sleep 5
# Run the script for CSV time-series update if the data feed file exists
if [ "$OS_TYPE" = "macOS" ] && [ -f "macos_data_feed.json" ]; then
echo "Processing: $OS_TYPE, update time-series.csv file."
python sofa-time-series.py --json macos_data_feed.json --csv time-series.csv
elif [ "$OS_TYPE" = "iOS" ] && [ -f "ios_data_feed.json" ]; then
echo "Processing: $OS_TYPE"
fi
done