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

This commit is contained in:
Leon van Kammen 2024-08-30 12:09:45 +02:00
parent 21ef86c99e
commit 0713c43225

22
make
View file

@ -6,7 +6,7 @@ DIR=$(dirname $(readlink -f $0))
export PATH=$PATH:. export PATH=$PATH:.
silent(){ "$@" 1>/dev/null 2>/dev/null; } silent(){ "$@" 1>/dev/null 2>/dev/null; }
install(){ deps(){ # check dependencies
echo "[v] checking dependencies " echo "[v] checking dependencies "
test -f ${APP}.com || { test -f ${APP}.com || {
wget "$REDBEAN_VERSION" -O ${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 rm ${APP}.com || true
test -f ${APP}.com || install test -f ${APP}.com || install
set -x set -x
@ -23,14 +24,14 @@ standalone(){
ls -lah ${APP}.com ls -lah ${APP}.com
} }
dev(){ dev(){ # start dev http server
cd "$DIR" cd "$DIR"
test -f xrsh.com || standalone 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 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 . "$@" ./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) OCI=$(which podman || which docker)
set -x set -x
$OCI rm -f xrsh || true $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' $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 PATH=$PATH:src/com/isoterminal/mnt
export BROWSER=0 export BROWSER=0
test -z $1 && find src/tests/vhs/* | xargs -n1 vhs test -z $1 && find src/tests/vhs/* | xargs -n1 vhs
test -z $1 || vhs $1 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 || "$@" test -z $1 || "$@"