-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuildSampleData.sh
More file actions
42 lines (28 loc) · 1.04 KB
/
buildSampleData.sh
File metadata and controls
42 lines (28 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
39
40
41
42
#!/bin/bash
# Load configuration
if [ -f .env ]; then
echo "Loading.env"
source .env || { echo "Could not load .env"; exit 1; }
else
echo "Could not find .env"; exit 1;
fi
# make the destination path by combining WISE_EXTERNAL_DATA_FOLDER + WISE_DATASET_FOLDER
# before we move on we must make sure that both inportant variuables are not empty
if [ -z "$WISE_EXTERNAL_DATA_FOLDER" ]; then
echo "WISE_EXTERNAL_DATA_FOLDER is not set. Exiting."
exit 1
fi
if [ -z "$WISE_DATASET_FOLDER" ]; then
echo "WISE_DATASET_FOLDER is not set. Exiting."
exit 1
fi
# Ensure the script exits on any error
set -e
# Combine the environment variables into a destination path
DESTINATION_PATH="${WISE_EXTERNAL_DATA_FOLDER}/${WISE_DATASET_FOLDER}/"
# Create the destination directory if it doesn't exist
mkdir -p "$DESTINATION_PATH"
# Print the destination path for debugging
echo "Destination path: $DESTINATION_PATH"
cat ./sample_data/wise_demo_data_part-* > ./sample_data/wise_demo_data.zip
unzip -j ./sample_data/wise_demo_data.zip -d $DESTINATION_PATH