2023-07-13 07:02:38 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
remove_if_directory_exists() {
|
|
|
|
if [ -d "$1" ]; then rm -Rf "$1"; fi
|
|
|
|
}
|
|
|
|
|
|
|
|
BRANCH="master"
|
|
|
|
|
2023-07-13 12:38:08 +00:00
|
|
|
REPOSITORY="https://$CHARTING_LIBRARY_USERNAME:$CHARTING_LIBRARY_ACCESS_TOKEN@$CHARTING_LIBRARY_REPOSITORY"
|
2023-07-13 07:02:38 +00:00
|
|
|
|
|
|
|
LATEST_HASH=$(git ls-remote $REPOSITORY $BRANCH | grep -Eo '^[[:alnum:]]+')
|
|
|
|
|
|
|
|
remove_if_directory_exists "$LATEST_HASH"
|
|
|
|
|
|
|
|
git clone -q --depth 1 -b "$BRANCH" $REPOSITORY "$LATEST_HASH"
|
|
|
|
|
2024-02-13 10:33:13 +00:00
|
|
|
remove_if_directory_exists "public/charting_library"
|
|
|
|
remove_if_directory_exists "public/datafeeds"
|
2023-07-13 07:02:38 +00:00
|
|
|
remove_if_directory_exists "src/utils/charting_library"
|
|
|
|
remove_if_directory_exists "src/utils/datafeeds"
|
|
|
|
|
|
|
|
cp -r "$LATEST_HASH/charting_library" public/
|
|
|
|
cp -r "$LATEST_HASH/charting_library" src/utils/
|
|
|
|
cp -r "$LATEST_HASH/datafeeds" public/
|
|
|
|
cp -r "$LATEST_HASH/datafeeds" src/utils/
|
|
|
|
|
|
|
|
remove_if_directory_exists "$LATEST_HASH"
|