xrsh/make

37 lines
953 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(){
2024-07-29 11:12:40 +02:00
rm ${APP}.com || true
2023-11-01 11:21:41 +01:00
test -f ${APP}.com || install
set -x
2024-07-29 11:12:40 +02:00
zip -x "*.git*" -r ${APP}.com index.html LICENSE src/index.{html,css} src/assets src/com/*.js src/com/isoterminal/{xrsh.iso,libv86.js,bios,v86.wasm}
sha256sum ${APP}.com > ${APP}.txt
ls -lah ${APP}.com
2023-11-01 11:21:41 +01:00
}
dev(){
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 || "$@"