Add scouts honor escape hatch for source embedding

This commit is contained in:
Justine Tunney 2020-06-15 19:01:28 -07:00
parent c91b3c5006
commit b4269930f7
547 changed files with 1516 additions and 944 deletions

33
examples/package/new.sh Executable file
View file

@ -0,0 +1,33 @@
#!/bin/sh
#
# SYNOPSIS
#
# Creates new package in repository.
#
# EXAMPLE
#
# examples/package/new.sh com/github/user/project
DIR=${1:?need directory arg}
VAR=$(echo "$DIR" | tr a-z A-Z | tr / _)
BASENAME=${DIR##*/}
FILENAME="$DIR/$BASENAME"
MAKEFILE="$DIR/$BASENAME.mk"
if [ -d "$DIR" ]; then
echo "already exists: $DIR" >&2
exit 1
fi
mkdir -p "$DIR" &&
cp -R examples/package/new/* "$DIR" &&
find "$DIR" -type f |
xargs sed -i -e "
s/EXAMPLES_PACKAGE/$VAR/g
s/examples\/package\/package/$FILENAME/g
s/examples\/package/$DIR/g
" &&
sed -i -e "
/#-φ-examples\/package\/new\.sh/i\
include $MAKEFILE
" Makefile