diff options
| author | David Sadler <david@flashacademy.com> | 2026-07-07 09:15:46 +0100 |
|---|---|---|
| committer | David Sadler <david@flashacademy.com> | 2026-07-07 09:15:46 +0100 |
| commit | 626c119a60701e2908e5795b3941078ebb8dba6b (patch) | |
| tree | ad8b6577953f50ad958051ef1d2493e8785ad4cb /bin/.bin/new-episode | |
| parent | 4c8d52122d962a0194737450e825471f27c93451 (diff) | |
| parent | fc2b007057dc763de14f9cd7860360bc5c9b646e (diff) | |
Merge branch 'main' into WSL
Diffstat (limited to 'bin/.bin/new-episode')
| -rwxr-xr-x | bin/.bin/new-episode | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/bin/.bin/new-episode b/bin/.bin/new-episode deleted file mode 100755 index c8a2305..0000000 --- a/bin/.bin/new-episode +++ /dev/null @@ -1,35 +0,0 @@ -#!/usr/bin/env bash - -if [ -z "$1" ]; then - echo "Usage: new-episode <number> <name>" - exit 1 -fi - -EP_NUM=$(printf "%03d" "$1") - -# Capture the Name (Shift the first arg so we can join the rest). -shift -RAW_NAME="${*:-untitled}" - -# Create the Title (Capitalize first letter of every word). -# Using a simple sed regex to capitalize words. -EP_TITLE=$(echo "$RAW_NAME" | sed 's/\b./\U&/g') - -# Create the Filename Slug (Lower case and replace spaces with hyphens) -# tr '[:upper:]' '[:lower:]' handles the casing -# tr ' ' '-' handles the spaces -SLUG=$(echo "$RAW_NAME" | tr '[:upper:]' '[:lower:]' | tr ' ' '-') -FILENAME="episode-${EP_NUM}-${SLUG}.php" - -# Generate the file -cat <<EOF > "$FILENAME" -<?php - -declare(strict_types=1); - -/** - * Episode ${EP_NUM}: ${EP_TITLE} - * The Coding Brummie Fundamental PHP Series - */ - -EOF |
