2023-06-07 00:05:30 -07:00
#!/usr/bin/env bash
2023-06-21 02:04:25 -07:00
echo "installing dependencies..."
npm install
2023-06-07 00:05:30 -07:00
2023-06-21 02:04:25 -07:00
echo "compiling eaglerproxy, please wait... "
echo "this may take a while when you first compile the proxy, or when the proxy has to be recompiled (usually due to modification of anything in the src folder, including config.ts)"
2023-06-21 03:45:22 -07:00
echo "after the initial compile, consequent startups will be a lot more faster and snappier"
2023-06-21 02:04:25 -07:00
set +e
cd ~/$REPL_SLUG /replit_runtime
node ./index.js
exit_code = $?
if [ $exit_code -eq 0 ] ; then
set -e
echo "detected that recompilation is not required, skipping and directly launching..."
elif [ $exit_code -eq 2 ] ; then
set -e
echo "recompiling proxy..."
rm -rf .build
mkdir -p ./.build
cd ~/$REPL_SLUG /
npm install typescript
npx tsc
echo "finished compiling, launching..."
else
echo " received non-zero exit code ( $? ), exiting! "
set -e
exit 1
fi
2023-06-07 00:05:30 -07:00