Skip to content

Commit

Permalink
Support trying local branches in submodule
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuaboniface committed Jan 21, 2019
1 parent 0dab69b commit cf85e23
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 8 deletions.
18 changes: 14 additions & 4 deletions build
Original file line number Diff line number Diff line change
Expand Up @@ -171,10 +171,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

# Execute each platform and action in order, if said action is enabled
Expand Down
18 changes: 14 additions & 4 deletions bump_version
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit cf85e23

Please sign in to comment.