diff options
| author | Joshua Boniface <joshua@boniface.me> | 2019-01-21 12:10:48 -0500 |
|---|---|---|
| committer | Joshua Boniface <joshua@boniface.me> | 2019-01-21 12:48:27 -0500 |
| commit | cf85e2327ed8fc0c3bdb54b08b5708b31bb0262d (patch) | |
| tree | 6af35604df0b5ebb67eb099a45300710e033f61d /bump_version | |
| parent | 0dab69b5519499f7bee7d85188ebe5628957a507 (diff) | |
Support trying local branches in submodule
Diffstat (limited to 'bump_version')
| -rwxr-xr-x | bump_version | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/bump_version b/bump_version index 0db6c18ad..c3f1a78d5 100755 --- a/bump_version +++ b/bump_version @@ -47,10 +47,20 @@ if ! git diff-index --quiet HEAD --; then fi git fetch --all -git checkout origin/${web_branch} || { - echo "ERROR: 'jellyfin-web' branch ${web_branch} is invalid." - exit 1 -} +# If this is an official branch name, fetch it from origin +official_branches_regex="^master$|^dev$|^release-.*$|^hotfix-.*$" +if [[ ${web_branch} =~ ${official_branches_regex} ]]; then + git checkout origin/${web_branch} || { + echo "ERROR: 'jellyfin-web' branch 'origin/${web_branch}' is invalid." + exit 1 + } +# Otherwise, just check out the local branch (for testing, etc.) +else + git checkout ${web_branch} || { + echo "ERROR: 'jellyfin-web' branch '${web_branch}' is invalid." + exit 1 + } +fi popd new_version="$1" |
