Skip to content

Commit

Permalink
Fail to start if no build folder exist
Browse files Browse the repository at this point in the history
  • Loading branch information
ChaseCares authored and Sean-Der committed Feb 20, 2024
1 parent 0f60fa4 commit 4e315a2
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ const (
networkTestIntroMessage = "\033[0;33mNETWORK_TEST_ON_START is enabled. If the test fails Broadcast Box will exit.\nSee the README for how to debug or disable NETWORK_TEST_ON_START\033[0m"
networkTestSuccessMessage = "\033[0;32mNetwork Test passed.\nHave fun using Broadcast Box.\033[0m"
networkTestFailedMessage = "\033[0;31mNetwork Test failed.\n%s\nPlease see the README and join Discord for help\033[0m"

noBuildDirectoryMessage = "\033[0;31mBuild directory does not exist, run `npm install` and `npm run build` in the web directory.\033[0m"
)

type (
Expand Down Expand Up @@ -177,6 +179,11 @@ func main() {
} else {
log.Println("Loading `" + envFileProd + "`")

_, err := os.Stat("./web/build")
if os.IsNotExist(err) {
log.Fatal(noBuildDirectoryMessage)
}

if err := godotenv.Load(envFileProd); err != nil {
log.Fatal(err)
}
Expand Down

0 comments on commit 4e315a2

Please sign in to comment.