commit 75d307e9d7a1cc99c95ac655cf043ac147c20b81 parent eaa0209d319134cc24dd8d09403aa4ccce9e53fc Author: pyratebeard <root@pyratebeard.net> Date: Sun, 6 Nov 2022 10:29:45 +0000 Merge branch 'main' into rnd.lit.rec Diffstat:
M | scripts/publish | | | 30 | +++++++++++++++++++++++------- |
1 file changed, 23 insertions(+), 7 deletions(-)
diff --git a/scripts/publish b/scripts/publish @@ -3,17 +3,29 @@ # use arg as title and set post file path # set published file path with date TITLE=$1 -POST="entry/${TITLE}.md" -PUBLISH="entry/$(date +%Y%m%d)-${TITLE}.md" -LINK="https://log.pyratebeard.net/entry/$(date +%Y%m%d)-${TITLE}.html" +RND=$2 + +if [ "$RND" = "mov" ] || [ "$RND" = "lit" ] ; then + POST="entry/rnd.${RND}.rec:_${TITLE}.md" + PUBLISH="entry/$(date +%Y%m%d)-rnd.${RND}.rec:_${TITLE}.md" + LINK="https://log.pyratebeard.net/entry/$(date +%Y%m%d)-rnd.${RND}.rec:_${TITLE}.html" +else + POST="entry/${TITLE}.md" + PUBLISH="entry/$(date +%Y%m%d)-${TITLE}.md" + LINK="https://log.pyratebeard.net/entry/$(date +%Y%m%d)-${TITLE}.html" +fi # toot command path TOOT="$HOME/src/warez/toot/bin/toot" # checkout the correct branch -git branch | grep ${TITLE} && \ - git checkout ${TITLE} || \ - git checkout -b ${TITLE} +if [ "$RND" = "mov" ] || [ "$RND" = "lit" ] ; then + git checkout -q rnd.${RND}.rec +else + git branch | grep ${TITLE} && \ + git checkout -q ${TITLE} || \ + exit 1 +fi # rename post to set date git mv "${POST}" "${PUBLISH}" @@ -23,7 +35,11 @@ git commit -S -m "publish ${TITLE}" # checkout main branch and merge published post git checkout main -git merge "${TITLE}" +if [ "$RND" = "mov" ] || [ "$RND" = "lit" ] ; then + git merge rnd.${RND}.rec +else + git merge "${TITLE}" +fi # push new post git push