diff --git a/update-files.sh b/update-files.sh new file mode 100755 index 0000000000000000000000000000000000000000..7e1f495457830828f96f06d272c9bc32618258ba --- /dev/null +++ b/update-files.sh @@ -0,0 +1,52 @@ +#!/usr/bin/env bash + +VERSION="" + +while [[ "$#" -gt 0 ]]; do + case $1 in + -v|--version) + VERSION=$2 + shift 2;; + *) + shift;; + esac +done + +# Initialize and update git submodules +git submodule init +git submodule update --remote + +if [ -n "$VERSION" ]; then + echo "Required version: $VERSION" + echo "Pulling files for version: $VERSION" + + for repo in "backend" "showcase-definition" "introductory-definition"; do + if [ -d "./$repo" ]; then + cd "./$repo" + + git fetch --tags &>/dev/null + git checkout main &>/dev/null # Ensure we are on a valid branch before switching + git checkout tags/$VERSION &>/dev/null + + cd ../ # Return to the main directory + fi + done +else + echo "No version provided, using the NEWEST files." +fi + + +# # Check the status of the git submodules +git submodule status + +# # Create necessary directories +mkdir -p docs/tech +mkdir -p files-from-repos + +# Copy files to the respective directories +cp ./backend/definitions/README.md ./docs/tech/architecture/definitions/README.md +cp ./backend/definitions/CHANGELOG.md ./docs/tech/architecture/definitions/CHANGELOG.md +cp ./backend/openapi.yml ./docs/tech/api/openapi.yml + +cp ./showcase-definition/assets/definition.zip ./files-from-repos/showcase-definition.zip +cp ./introductory-definition/assets/definition.zip ./files-from-repos/intro-definition.zip diff --git a/update-links.sh b/update-links.sh new file mode 100755 index 0000000000000000000000000000000000000000..5436ca537c3ce8f650f57b1298ce47a36ba6c124 --- /dev/null +++ b/update-links.sh @@ -0,0 +1,19 @@ +#!/usr/bin/env bash +NAME="" + +while [[ "$#" -gt 0 ]]; do + case $1 in + -n|--name) + NAME=$2 + shift 2;; + *) + shift;; + esac +done + +if [ -z "$NAME" ]; then + echo "No name provided, exiting..." + exit 1 +fi + +find . -type f -exec sed -i "s|/raw/main/|/raw/$NAME/|g" {} +