Skip to content

Instantly share code, notes, and snippets.

@mimikun
Last active May 8, 2024 09:53
Show Gist options
  • Save mimikun/e36a8905375a4cbfbbb5f49bd51844a7 to your computer and use it in GitHub Desktop.
Save mimikun/e36a8905375a4cbfbbb5f49bd51844a7 to your computer and use it in GitHub Desktop.
aqua-registry contribute用maskfile

aqua-registry contributing helper maskfile

pab

Create patch branch

USER_NAME="mattn"
REPO_NAME="sleepy"
BRANCH_NAME="feat/$USER_NAME/$REPO_NAME"
git branch "$BRANCH_NAME"

commit

Create empty commit

USER_NAME="mattn"
REPO_NAME="sleepy"
git commit -m "feat: add $USER_NAME/$REPO_NAME" --allow-empty --no-verify

clean

Delete unused files

rm -f ./*.patch
rm -f ./*.zip

diff-patch

Create a patch

PRODUCT_NAME="aqua-registry"
DEFAULT_REMOTE="origin"
DEFAULT_BRANCH="main"
TODAY=$(date +'%Y%m%d')
REPLACED_BRANCH_NAME=$(git branch --show-current | sed -e "s/\//_/g")

for p in "$PRODUCT_NAME" "_" "$REPLACED_BRANCH_NAME" "." "$TODAY" "." "patch"; do
    PATCH_NAME+=$p
done

echo "patch file name: $PATCH_NAME"
git diff "$DEFAULT_REMOTE/$DEFAULT_BRANCH" >"$PATCH_NAME"

patch

Create patch file and copy to windows

mask clean
mask diff-patch
cp *.patch $WIN_HOME/Downloads/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment