all repos — underbbs @ fd2abcbb76e9e70883e86e29b93a3f0b24e08f29

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

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