all repos — underbbs @ 44bdad2e509c30962c79155a16e6d499bbaf3791

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
  client)
    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
      rm ${buildlog}
    else
      npx webpack --config webpack.config.js
    fi
    ;;
  server)
    go mod tidy
    go build
    ;;
  *)
    $0 client
    $0 server
    ;;
esac