From cf7251a69f25467c8da5f72996bc8dfd53f6a63e Mon Sep 17 00:00:00 2001 From: sripwoud Date: Wed, 10 Jul 2024 22:01:37 +0200 Subject: [PATCH] refactor: update publish for forge script --- scripts/publish-for-forge.sh | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/scripts/publish-for-forge.sh b/scripts/publish-for-forge.sh index a9591cf..76097a2 100755 --- a/scripts/publish-for-forge.sh +++ b/scripts/publish-for-forge.sh @@ -22,10 +22,9 @@ maybe_publish_forge_pkg() { current_branch=$(git branch --show-current) latest_commit_msg=$(git log -1 --pretty=%B) - # latest already published - [ "$latest_commit_msg" = "$version" ] && return - git checkout -b "$pkg" + # return early if latest already published + [ "$latest_commit_msg" = "$version" ] && return git status git pull --rebase origin "$pkg" clean "$pkg" @@ -38,7 +37,7 @@ maybe_publish_forge_pkg() { git checkout "$current_branch" } -maybe_publish_forge_pkgs() { +main() { # http://mywiki.wooledge.org/BashFAQ/001 # https://github.com/koalaman/shellcheck/wiki/SC2012 find packages -maxdepth 1 -mindepth 1 -printf '%P\n' | while read -r pkg; do @@ -46,10 +45,4 @@ maybe_publish_forge_pkgs() { done } -main() { - maybe_publish_forge_pkgs - # TODO: uncomment - # publish_npm -} - main