all repos — underbbs @ 2976d438d90bea2beb4e67272fd628ff163459f2

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
  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
    ;;
  *)
    echo "usage: ${0} <front|server>"
    ;;
esac