|
5 | 5 | # 2. Update the version of code-server (package.json, docs, etc.)
|
6 | 6 | # 3. Update the code coverage badge in the README
|
7 | 7 | # 4. Open a draft PR using the release_template.md and view in browser
|
8 |
| -# If you want to perform a dry run of this script run DRY_RUN=0 yarn release:prep |
| 8 | +# If you want to perform a dry run of this script run DRY_RUN=1 yarn release:prep |
9 | 9 |
|
10 | 10 | set -euo pipefail
|
11 | 11 |
|
@@ -91,12 +91,19 @@ main() {
|
91 | 91 | # Updates the svg to be green for the badge
|
92 | 92 | $CMD sd "red.svg" "green.svg" ../../README.md
|
93 | 93 |
|
94 |
| - $CMD git add . && $CMD git commit -am "chore(release): bump version to $CODE_SERVER_VERSION_TO_UPDATE" |
| 94 | + $CMD git commit -am "chore(release): bump version to $CODE_SERVER_VERSION_TO_UPDATE" |
95 | 95 |
|
96 |
| - CURRENT_BRANCH=$(git branch --show-current) |
97 | 96 | # Note: we need to set upstream as well or the gh pr create step will fail
|
98 | 97 | # See: https://github.com/cli/cli/issues/575
|
99 |
| - $CMD git push -u origin "$CURRENT_BRANCH" |
| 98 | + CURRENT_BRANCH=$(git branch | grep '\*' | cut -d' ' -f2-) |
| 99 | + if [[ -z $(git config "branch.${CURRENT_BRANCH}.remote") ]]; then |
| 100 | + echo "Doesn't look like you've pushed this branch to remote" |
| 101 | + echo -e "Pushing now using: git push origin $CURRENT_BRANCH\n" |
| 102 | + # Note: we need to set upstream as well or the gh pr create step will fail |
| 103 | + # See: https://github.com/cli/cli/issues/575 |
| 104 | + echo "Please set the upstream and re-run the script" |
| 105 | + exit 1 |
| 106 | + fi |
100 | 107 |
|
101 | 108 | # This runs from the root so that's why we use this path vs. ../../
|
102 | 109 | RELEASE_TEMPLATE_STRING=$(cat ./.github/PULL_REQUEST_TEMPLATE/release_template.md)
|
|
0 commit comments