From 8eed410f48de90be40e2d42134ec54db104a9a6f Mon Sep 17 00:00:00 2001 From: Adam Fowler Date: Sat, 23 Dec 2023 07:49:21 +0100 Subject: [PATCH] Remove scripts --- scripts/build-docs.sh | 76 ------------------------------------------ scripts/commit-docs.sh | 38 --------------------- 2 files changed, 114 deletions(-) delete mode 100755 scripts/build-docs.sh delete mode 100755 scripts/commit-docs.sh diff --git a/scripts/build-docs.sh b/scripts/build-docs.sh deleted file mode 100755 index f1471ce88..000000000 --- a/scripts/build-docs.sh +++ /dev/null @@ -1,76 +0,0 @@ -#!/usr/bin/env bash - -set -eux - -PROJECT=${1:-} -CWD=$(pwd) -TEMP_DIR=$(mktemp -d) - -get_latest_version() { - RELEASE_REVISION=$(git rev-list --tags --max-count=1) - echo $(git describe --tags "$RELEASE_REVISION") -} - -build_docs() { - GITHUB_FOLDER=$1 - DOCS_FOLDER=$2 - shift 2 - MODULES=$* - - if [[ -n "$PROJECT" ]]; then - if [[ "$DOCS_FOLDER" != "$PROJECT" ]]; then - return - fi - fi - SOURCEKITTEN_FOLDER="$TEMP_DIR/sourcekitten/$DOCS_FOLDER" - - mkdir -p $SOURCEKITTEN_FOLDER - - SOURCEKITTEN_FILES="" - for MODULE in $MODULES; - do - echo "$MODULE" - sourcekitten doc --spm --module-name "$MODULE" > $SOURCEKITTEN_FOLDER/"$MODULE".json - if [ -z "$SOURCEKITTEN_FILES" ]; then - SOURCEKITTEN_FILES=$SOURCEKITTEN_FOLDER/"$MODULE".json - else - SOURCEKITTEN_FILES="$SOURCEKITTEN_FILES,$SOURCEKITTEN_FOLDER/"$MODULE".json" - fi - done - - VERSION=$(get_latest_version) - jazzy \ - --clean \ - --author "Adam Fowler" \ - --author_url https://github.com/adam-fowler \ - --github_url https://github.com/hummingbird-project/"$GITHUB_FOLDER" \ - --module-version "$VERSION" \ - --sourcekitten-sourcefile "$SOURCEKITTEN_FILES" \ - --readme "$CWD"/documentation/readme.md \ - --documentation "documentation/[^r]*.md" \ - --output "$CWD"/docs/"$DOCS_FOLDER" -} - -build_docs_from_other_repo() { - GITHUB_FOLDER=$1 - - pushd "$TEMP_DIR" - git clone https://github.com/hummingbird-project/"$GITHUB_FOLDER" - cd "$GITHUB_FOLDER" - build_docs $* - - popd -} - -build_docs hummingbird hummingbird Hummingbird -build_docs hummingbird hummingbird-foundation HummingbirdFoundation -build_docs hummingbird hummingbird-jobs HummingbirdJobs -build_docs hummingbird hummingbird-xct HummingbirdXCT - -build_docs_from_other_repo hummingbird-core hummingbird-core HummingbirdCore -build_docs_from_other_repo hummingbird-auth hummingbird-auth HummingbirdAuth -build_docs_from_other_repo hummingbird-mustache hummingbird-mustache HummingbirdMustache -build_docs_from_other_repo hummingbird-websocket hummingbird-websocket HummingbirdWebSocket HummingbirdWSClient HummingbirdWSCore - - -rm -rf "$TEMP_DIR" diff --git a/scripts/commit-docs.sh b/scripts/commit-docs.sh deleted file mode 100755 index 73426b3fe..000000000 --- a/scripts/commit-docs.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/bash - -set -eux - -FOLDER=current -SUBFOLDER=${1:-} - -# stash everything that isn't in docs, store result in STASH_RESULT -STASH_RESULT=$(git stash push -- ":(exclude)docs") -# get branch name -CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD) -REVISION_HASH=$(git rev-parse HEAD) - -git checkout gh-pages -if [[ -z "$SUBFOLDER" ]]; then - # copy contents of docs to docs/current replacing the ones that are already there - rm -rf "$FOLDER" - mv docs/ "$FOLDER"/ - # commit - git add --all "$FOLDER" -else - # copy contents of subfolder of docs to docs/current replacing the ones that are already there - rm -rf "$FOLDER"/"$SUBFOLDER" - mv docs/"$SUBFOLDER"/ "$FOLDER"/"$SUBFOLDER" - # commit - git add --all "$FOLDER"/"$SUBFOLDER" -fi - -git status -git commit -m "Documentation for https://github.com/hummingbird-project/hummingbird/tree/$REVISION_HASH" -git push -# return to branch -git checkout $CURRENT_BRANCH - -if [ "$STASH_RESULT" != "No local changes to save" ]; then - git stash pop -fi -