BetterReplit and Readme

This commit is contained in:
Rockpods 2022-03-27 12:48:39 -05:00 committed by GitHub
parent 228a7ed4b6
commit 08833ab4b0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 4 deletions

View file

@ -1,2 +1,3 @@
language = "nodejs"
run = "bash main.sh"
run = "./main.sh"
onBoot = "chmod u+x main.sh"

View file

@ -62,7 +62,8 @@ $ npm start
## Replit Setup Guide
To setup on Replit, first click on the "Run on Replit" button. After loading into your repl, run the following commands:
To setup on Replit, first click on the "Run on Replit" button. After loading into your repl, click on the green "Run" button. Alternatively, run the following commands:
```sh
$ npm install
$ chmod +x main.sh

15
main.sh
View file

@ -1,2 +1,13 @@
git submodule update --init
npm start
#!/bin/bash
# Set this to 1 to automatically attempt a fix when an error occurs while running npm start.
fix=0
# Stuff to do at first run(submodule, npm install).
if [[ -d "static" && -n "$(find static -prune -empty 2>/dev/null)" ]] || [[ ! -d "static" ]]; then
npm install
git submodule update --init --recursive
fi
npm start || [[ $fix = 1 ]] && npm install && npm update && git submodule update --init --recursive