Skip to content

Commit

Permalink
Merge pull request #34 from mtlynch/set-e-1
Browse files Browse the repository at this point in the history
Use the set -e option in scripts.sh
  • Loading branch information
0x2E authored Dec 22, 2024
2 parents ac2570c + c0a893a commit d1b41a6
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions scripts.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
#!/bin/sh

# Exit on first failure.
set -e

gen() {
go generate ./...
}

test_go() {
gen || exit 1
gen
# make some files for embed
mkdir -p ./frontend/build && touch ./frontend/build/index.html || exit 1
mkdir -p ./frontend/build
touch ./frontend/build/index.html
go test ./...
}

Expand All @@ -17,12 +21,14 @@ build() {
test_go

root=$(pwd)
mkdir build
mkdir -p ./build
echo "building frontend"
cd ./frontend && npm i && npm run build || exit 1
cd $root || exit 1
cd ./frontend
npm i
npm run build
cd $root
echo "building backend"
go build -o ./build/fusion ./cmd/server/* || exit 1
go build -o ./build/fusion ./cmd/server/*
}

dev() {
Expand Down

0 comments on commit d1b41a6

Please sign in to comment.