aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2023-02-23 10:38:09 -0300
committerEuAndreh <eu@euandre.org>2023-02-23 10:38:09 -0300
commitc8490736140fb76c973535936b657f4557c2aeb5 (patch)
tree8641f10838073801faaf8b475e595d560c243766
parentetc/sh/rc: Remove "vi" alias (diff)
downloaddotfiles-c8490736140fb76c973535936b657f4557c2aeb5.tar.gz
dotfiles-c8490736140fb76c973535936b657f4557c2aeb5.tar.xz
bin/aux: Add semi-working utility
-rwxr-xr-xbin/aux82
1 files changed, 82 insertions, 0 deletions
diff --git a/bin/aux b/bin/aux
new file mode 100755
index 0000000..e51cfe8
--- /dev/null
+++ b/bin/aux
@@ -0,0 +1,82 @@
+#!/bin/sh
+set -eu
+
+
+usage() {
+ cat <<-'EOF'
+ Usage:
+ aux
+ aux -h
+ EOF
+}
+
+help() {
+ cat <<-'EOF'
+
+
+ Options:
+ -h, --help show this message
+
+
+ Hydrate software project with auxiliary files.
+
+
+ Examples:
+
+ Just run it:
+
+ $ aux
+ EOF
+}
+
+
+for flag in "$@"; do
+ case "$flag" in
+ --)
+ break
+ ;;
+ --help)
+ usage
+ help
+ exit
+ ;;
+ *)
+ ;;
+ esac
+done
+
+while getopts 'h' flag; do
+ case "$flag" in
+ h)
+ usage
+ help
+ exit
+ ;;
+ *)
+ usage >&2
+ exit 2
+ ;;
+ esac
+done
+shift $((OPTIND - 1))
+
+D="${XDG_DATA_HOME:-$HOME/.local/share}"/aux-repo
+
+cp_all() {
+ for f in "$@"; do
+ mkdir -p "$(dirname "$f")"
+ cp -v "$D/$f" "$f"
+ done
+}
+
+cp_all \
+ aux/.gitignore \
+ aux/lib.sh \
+ aux/tld.txt \
+ aux/workflow/favicon.svg \
+ aux/workflow/head.html \
+ aux/workflow/md2html.sh \
+ aux/workflow/style.css \
+ aux/workflow/preamble.md.in \
+ aux/workflow/TODOs.sh \
+ aux/ci/report.sh \