Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions app/start.ps1
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# set the parent of the script as the current location.
Set-Location $PSScriptRoot

Write-Host ""
Write-Host "Loading azd .env file from current environment"
Write-Host ""
Expand Down
24 changes: 16 additions & 8 deletions app/start.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#!/bin/sh

# cd into the parent directory of the script,
# so that the script generates virtual environments always in the same path.
cd "${0%/*}" || exit 1

cd ../
echo 'Creating python virtual environment ".venv"'
python3 -m venv .venv
Expand All @@ -9,9 +13,10 @@ echo "Restoring backend python packages"
echo ""

./.venv/bin/python -m pip install -r app/backend/requirements.txt
if [ $? -ne 0 ]; then
out=$?
if [ $out -ne 0 ]; then
echo "Failed to restore backend python packages"
exit $?
exit $out
fi

echo ""
Expand All @@ -20,19 +25,21 @@ echo ""

cd app/frontend
npm install
if [ $? -ne 0 ]; then
out=$?
if [ $out -ne 0 ]; then
echo "Failed to restore frontend npm packages"
exit $?
exit $out
fi

echo ""
echo "Building frontend"
echo ""

npm run build
if [ $? -ne 0 ]; then
out=$?
if [ $out -ne 0 ]; then
echo "Failed to build frontend"
exit $?
exit $out
fi

echo ""
Expand All @@ -44,7 +51,8 @@ cd ../backend
port=50505
host=localhost
../../.venv/bin/python -m quart --app main:app run --port "$port" --host "$host" --reload
if [ $? -ne 0 ]; then
out=$?
if [ $out -ne 0 ]; then
echo "Failed to start backend"
exit $?
exit $out
fi