added docs to cli make
/ mirror_to_github (push) Failing after 27s Details
/ test (push) Successful in 5s Details

This commit is contained in:
Leon van Kammen 2024-08-30 12:09:45 +02:00
parent 21ef86c99e
commit 0713c43225
1 changed files with 16 additions and 6 deletions

22
make
View File

@ -6,7 +6,7 @@ DIR=$(dirname $(readlink -f $0))
export PATH=$PATH:.
silent(){ "$@" 1>/dev/null 2>/dev/null; }
install(){
deps(){ # check dependencies
echo "[v] checking dependencies "
test -f ${APP}.com || {
wget "$REDBEAN_VERSION" -O ${APP}.com
@ -14,7 +14,8 @@ install(){
}
}
standalone(){
standalone(){ # build standalone xrsh.com binary
deps
rm ${APP}.com || true
test -f ${APP}.com || install
set -x
@ -23,14 +24,14 @@ standalone(){
ls -lah ${APP}.com
}
dev(){
dev(){ # start dev http server
cd "$DIR"
test -f xrsh.com || standalone
test -f /tmp/cert.pem || openssl req -newkey rsa:2048 -new -nodes -x509 -days 3650 -keyout /tmp/key.pem -out /tmp/cert.pem
./xrsh.com -c 0 -C /tmp/cert.pem -K /tmp/key.pem -D . "$@"
}
shell(){
shell(){ # run xrsh shell via docker
OCI=$(which podman || which docker)
set -x
$OCI rm -f xrsh || true
@ -39,12 +40,21 @@ shell(){
$OCI exec -it xrsh /bin/sh -i -c 'ln -s /mnt/profile /etc/profile && sh --login'
}
recordings(){
recordings(){ # compile vhs recordings
export PATH=$PATH:src/com/isoterminal/mnt
export BROWSER=0
test -z $1 && find src/tests/vhs/* | xargs -n1 vhs
test -z $1 || vhs $1
}
test -z $1 && install
deploy(){ # deploy to server(s)
}
usage(){
echo "Usage:"
awk '/\(\){ #/ { gsub(/\(\){ #/," <----",$0); print " ./make "$0 }' $0
}
test -z $1 && usage
test -z $1 || "$@"