all repos — underbbs @ fead16168a5af4d28606cc1a7cef0b23ce85ed6c

decentralized social media client

build.sh (raw)

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
#!/bin/sh

case "$1" in
  front)
    if [ ! -e ./frontend/.js ]; then
      mkdir ./frontend/.js
    fi
    buildlog=$(mktemp)
    if [ ! -z $"{PLAN9}" ]; then
      npx tsc 2>&1 | nobs | sed -e 's/\.ts\(/\.ts:/g' -e 's/,[0-9]+\)://g' > ${buildlog}
    else
      npx tsc 2>&1 > ${buildlog}
    fi
    if [ -s ${buildlog} ]; then
      cat ${buildlog} | head
    else
      npx webpack --config webpack.config.js
    fi
    rm ${buildlog}
    ;;
  server)
    go mod tidy
    go build
    ;;
  *)
    $0 client
    $0 server
    ;;
esac