aboutsummaryrefslogtreecommitdiff
path: root/src/development/dynmake.sh
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2022-06-01 19:57:56 -0300
committerEuAndreh <eu@euandre.org>2022-06-01 19:58:49 -0300
commit6ae4f67afc8e804fac17447613ff8f6ee9fe60bf (patch)
tree28f58cdcec01af65af2d5b4ffa7a2008e0ee3e1f /src/development/dynmake.sh
parentTODOs.md: Add #td-c409cad6-6660-81d8-b7ad-a0d61329ef3c (diff)
downloadeuandre.org-6ae4f67afc8e804fac17447613ff8f6ee9fe60bf.tar.gz
euandre.org-6ae4f67afc8e804fac17447613ff8f6ee9fe60bf.tar.xz
Start building pastebins with dynamic.mk
Diffstat (limited to 'src/development/dynmake.sh')
-rwxr-xr-xsrc/development/dynmake.sh22
1 files changed, 8 insertions, 14 deletions
diff --git a/src/development/dynmake.sh b/src/development/dynmake.sh
index 3f173da..9c60b88 100755
--- a/src/development/dynmake.sh
+++ b/src/development/dynmake.sh
@@ -4,7 +4,7 @@ set -eu
usage() {
cat <<-'EOF'
Usage:
- dynmake.sh -n VARNAME -d DIR
+ dynmake.sh
dynmake.sh -h
EOF
}
@@ -32,14 +32,8 @@ for flag in "$@"; do
esac
done
-while getopts 'd:n:h' flag; do
+while getopts 'h' flag; do
case "$flag" in
- d)
- DIR="$OPTARG"
- ;;
- n)
- NAME="$OPTARG"
- ;;
h)
usage
help
@@ -55,18 +49,18 @@ shift $((OPTIND - 1))
assert_arg() {
if [ -z "$1" ]; then
- printf 'Missing %s.' "$2" >&2
+ printf 'Missing %s.\n' "$2" >&2
exit 2
fi
}
-assert_arg "${DIR:-}" '-d DIR'
-assert_arg "${NAME:-}" '-n NAME'
-
-printf '%s = \\\n' "$NAME"
-find "$DIR" -type f |
+printf 'pastebins.md = \\\n'
+find src/content/pastebin -name '*.md' |
sed -e 's/^/ /' \
-e 's/$/ \\/'
printf '\n'
+
+find src/content/pastebin -name '*.md' |
+ sed 's/^\(.*\)\.md$/\1.html: \1.env/'