-
-
Save TingPing/62714aea793856e42c7c556dc46caf49 to your computer and use it in GitHub Desktop.
This file contains 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
#!/usr/bin/env bash | |
set -euf -o pipefail | |
id=$1 | |
pr=$2 | |
if [ ! -d "$id" ]; then | |
mkdir $id | |
pushd $id | |
git init | |
gh pull-request --user flathub --repo flathub --number "$pr" --fetch --merge | |
# If they forked the new-pr branch it has an empty commit, remove it | |
git filter-branch --parent-filter 'sed -e "s/-p 746ea89cc4ff85ad2dbc05fb47efde23de4062f8//"' -- --all | |
else | |
pushd $id | |
fi | |
gh repo --new "$id" --organization flathub | |
git remote add origin "git@github.com:flathub/$id.git" | |
git push --set-upstream origin master | |
gh pull-request --user flathub --repo flathub --number "$pr" --comment "Repository has been created: https://github.com/flathub/$id" | |
gh pull-request --user flathub --repo flathub --number "$pr" --close |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment