Last active
August 7, 2024 01:26
-
-
Save i80and/834ccd5377272eceb95a3437b387706a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| set -e | |
| DOCS_REPO=$1 | |
| DRIVER_REPO=$2 | |
| BRANCH=$3 | |
| DRIVER_BRANCH=$4 | |
| usage() { | |
| echo "do.sh <docs-url> <driver-url> <branch>" | |
| exit 1 | |
| } | |
| if [ -z "$DOCS_REPO" ]; then | |
| usage | |
| fi | |
| if [ -z "$DRIVER_REPO" ]; then | |
| usage | |
| fi | |
| if [ -z "$BRANCH" ]; then | |
| usage | |
| fi | |
| rm -rf docs driver || true | |
| git clone -b "$BRANCH" "$DOCS_REPO" docs | |
| git clone -b "$DRIVER_BRANCH" "$DRIVER_REPO" driver | |
| ( | |
| cd driver | |
| git filter-repo --path docs --path-rename docs/:source/ | |
| ) | |
| ( | |
| cd docs | |
| git remote add driver-repo ../driver | |
| git fetch driver-repo | |
| git merge "remotes/driver-repo/$DRIVER_BRANCH" --allow-unrelated-histories | |
| ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment