Skip to content
This repository has been archived by the owner on Aug 17, 2023. It is now read-only.

Commit

Permalink
update package.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
tatsumoto-ren committed Aug 24, 2021
1 parent 7f3fcc3 commit 801b26a
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions package.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
#!/usr/bin/env bash

readonly ADDON_NAME=ajt_furigana
readonly ROOT_DIR=$(git rev-parse --show-toplevel)
readonly BRANCH=$(git branch --show-current)
readonly ARCHIVE=ajt_furigana_${BRANCH}.ankiaddon
readonly BRANCH=${1:-$(git branch --show-current)}
readonly ZIP_NAME=${ADDON_NAME}_${BRANCH}.ankiaddon

cd -- "$ROOT_DIR" || exit 1

export ROOT_DIR BRANCH

git archive HEAD --format=zip --output "$ARCHIVE"
git archive "$BRANCH" --format=zip --output "$ZIP_NAME"

# shellcheck disable=SC2016
git submodule foreach 'git archive HEAD --prefix=$path/ --format=zip --output "$ROOT_DIR/${path}_${BRANCH}.zip"'
zipmerge "$ARCHIVE" ./*.zip

zipmerge "$ZIP_NAME" ./*.zip
rm -- ./*.zip

0 comments on commit 801b26a

Please sign in to comment.