GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — tememo/scripts/publish-post.sh at develop · anlt149/tememo Expand file tree/ Copy pathpublish-post.shMore file actions executable file ·52 lines (38 loc) · 1.14 KB / Copy pathpublish-post.shFile metadata and controlsexecutable file ·52 lines (38 loc) · 1.14 KB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 #!/bin/bash # Publish a blog post by staging, verifying, committing, and pushing. if [ -z "$1" ]; then echo "Usage: ./scripts/publish-post.sh <path-to-blog-post>" echo "Example: ./scripts/publish-post.sh src/content/blog/my-new-post.md" exit 1 fi FILE="$1" if [[ "$FILE" != /* ]]; then FILE="$(pwd)/$FILE" fi if [ ! -f "$FILE" ]; then echo "Error: File $FILE does not exist." exit 1 fi # Ensure we are in the root directory cd "$(dirname "$0")/.." || exit 1 # Extract the title from the frontmatter for the commit message TITLE=$(grep "^title:" "$FILE" | sed 's/^title: *//' | sed 's/^"//;s/"$//' | sed "s/^'//;s/'$//") if [ -z "$TITLE" ]; then TITLE=$(basename "$FILE") fi echo "Publishing: $TITLE" # Stage the file so the verify script can pick it up git add "$FILE" # Run the verification script echo "Running verification..." ./scripts/verify-blog-post.sh if [ $? -ne 0 ]; then echo "Verification failed. Unstaging $FILE..." git restore --staged "$FILE" exit 1 fi echo "Verification passed. Committing..." git commit -m "docs: publish post '$TITLE'" echo "Pushing to remote..." git push echo "Successfully published '$TITLE'!" |
| You are visitor 01402792 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |