Some checks failed
Telegram Mini App Shop Builder / Compute version metadata (push) Has been cancelled
Telegram Mini App Shop Builder / Run Frontend tests (push) Has been cancelled
Telegram Mini App Shop Builder / Run Backend tests (push) Has been cancelled
Telegram Mini App Shop Builder / Run PHP_CodeSniffer (push) Has been cancelled
Telegram Mini App Shop Builder / Build module. (push) Has been cancelled
Telegram Mini App Shop Builder / release (push) Has been cancelled
36 lines
709 B
Bash
Executable File
36 lines
709 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# The script downloads and unzip ocStore.
|
|
# Should be executed from the project root folder.
|
|
|
|
set -e
|
|
|
|
OCSTORE_VERSION=v3.0.3.7
|
|
CACHE_DIR=.cache
|
|
|
|
echo "👽 Downloading ocStore ${OCSTORE_VERSION}..."
|
|
|
|
DOWNLOAD_URL="https://github.com/ocStore/ocStore/archive/refs/tags/$OCSTORE_VERSION.zip"
|
|
|
|
FILE_PATH="$CACHE_DIR/$OCSTORE_VERSION.zip"
|
|
|
|
if [ ! -f "$FILE_PATH" ]; then
|
|
mkdir -p "$CACHE_DIR"
|
|
wget -P "$CACHE_DIR" "$DOWNLOAD_URL"
|
|
else
|
|
echo "😎 Get file from cache: $FILE_PATH"
|
|
fi
|
|
|
|
echo "🗃 Unzipping..."
|
|
rm -rf src/*
|
|
|
|
unzip -q "$FILE_PATH" -d ./src
|
|
SOURCE_DIR=src/ocStore-${OCSTORE_VERSION//v/}
|
|
|
|
rsync -a $SOURCE_DIR/* ./src
|
|
rm -rf $SOURCE_DIR
|
|
|
|
chmod -R 775 src
|
|
|
|
echo "✅ Completed."
|