xrsh/make

38 lines
872 B
Text
Raw Normal View History

2023-11-01 11:21:41 +01:00
#!/bin/sh
REDBEAN_VERSION=https://redbean.dev/redbean-2.2.com
2023-12-18 09:54:52 +01:00
APP=xrsh
2024-05-22 08:23:56 +00:00
DIR=$(dirname $(readlink -f $0))
2023-11-01 11:21:41 +01:00
export PATH=$PATH:.
silent(){ "$@" 1>/dev/null 2>/dev/null; }
install(){
echo "[v] checking dependencies "
test -f ${APP}.com || {
wget "$REDBEAN_VERSION" -O ${APP}.com
chmod +x ${APP}.com
}
standalone
}
standalone(){
test -f ${APP}.com || install
cd src
set -x
2024-05-22 08:23:56 +00:00
zip -x "*.git*" -r ../${APP}.com *
2023-11-01 11:21:41 +01:00
ls -lah ../${APP}.com
}
dev(){
2024-05-22 08:23:56 +00:00
test -d src/xrsh-apps || git submodule update --init --recursive
2023-11-01 11:21:41 +01:00
cd /tmp
test -f redbean.com || wget "$REDBEAN_VERSION" -O redbean.com && chmod 755 redbean.com
test -f cert.pem || openssl req -newkey rsa:2048 -new -nodes -x509 -days 3650 -keyout key.pem -out cert.pem
cd -
2024-05-22 08:23:56 +00:00
cd "$DIR"
2024-05-10 08:37:24 +00:00
/tmp/redbean.com -c 0 -C /tmp/cert.pem -K /tmp/key.pem -D . "$@"
2023-11-01 11:21:41 +01:00
}
test -z $1 && install
test -z $1 || "$@"