-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmake
More file actions
executable file
·35 lines (31 loc) · 723 Bytes
/
make
File metadata and controls
executable file
·35 lines (31 loc) · 723 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/bash
REDBEAN_STATIC=redbean.com
VERSION=2.2
NAME=soakbean
to_elf(){
zip -d $NAME.com .ape
zip -sf $NAME.com
./$NAME.com -h &>/dev/null
}
all(){
set -x
[[ ! -f $REDBEAN_STATIC ]] && wget https://redbean.dev/redbean-${VERSION}.com -O $REDBEAN_STATIC
[[ -f $REDBEAN_STATIC ]] && cp $REDBEAN_STATIC $NAME.com
cp middleware/json.lua src/.lua/.
cd src
zip -q -r ../$NAME.com * .lua .init.lua
chmod 755 ../$NAME.com
set +x
cd -
ls -lah $NAME.com
}
docker(){
docker=$(which docker)
to_elf
set -x
$docker build . -t $NAME && \
$docker images | grep $NAME && \
$docker run -p 8080:8080 $NAME
}
[[ ! -n $1 ]] && { echo "usage: ./make all && ./soakbean.com"; exit 0; }
"$@"