-
-
Notifications
You must be signed in to change notification settings - Fork 162
Expand file tree
/
Copy pathsplit
More file actions
executable file
·28 lines (20 loc) · 823 Bytes
/
split
File metadata and controls
executable file
·28 lines (20 loc) · 823 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/env bash
PACKAGE_NAME=$1
SUBSPLIT_DIR="${PACKAGE_NAME}_subsplit"
# Clone our Tempest repository and jump into it.
git clone https://github.com/tempestphp/tempest-framework "$SUBSPLIT_DIR"
cd "$SUBSPLIT_DIR"
# Get the current default branch of the Tempest repo.
DEFAULT_BRANCH=$(git branch --show-current)
# Filter the history down to only the one package.
git filter-repo --subdirectory-filter "packages/${PACKAGE_NAME}"
# Setup our remote repository we are splitting to.
git remote add origin "https://x-access-token:${SUBSPLIT_TOKEN}@github.com/tempestphp/tempest-${PACKAGE_NAME}.git"
git branch -m "$DEFAULT_BRANCH"
# Push all branches + history to the repo.
git push --force --all origin
# Push all releases / tags to the repo.
git push --force --tags origin
# Cleanup
cd ../
rm -rf "${SUBSPLIT_DIR}"