Skip to content

Commit

Permalink
Fixes a clean yarn start
Browse files Browse the repository at this point in the history
  • Loading branch information
Dartoxian committed Dec 18, 2023
1 parent 65a64f3 commit 197381f
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 5 deletions.
6 changes: 3 additions & 3 deletions enclave-manager/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@
"build:cloudDev": "dotenv -e packages/app/.env.cloudDevelopment -- lerna run --stream build",
"prettier": "prettier . --check",
"prettier:fix": "prettier . --write",
"start": "REACT_APP_VERSION=$(git fetch origin --tags -q && git describe --dirty --match '[0-9]*' --tags)-development lerna run --stream --scope @kurtosis/emui-app start",
"start:cloud": "REACT_APP_VERSION=$(git fetch origin --tags -q && git describe --dirty --match '[0-9]*' --tags)-cloudDevelopment lerna run --stream --scope @kurtosis/emui-app start:cloud",
"start:prod": "lerna run --stream --scope @kurtosis/emui-app start:prod",
"start": "REACT_APP_VERSION=$(git fetch origin --tags -q && git describe --dirty --match '[0-9]*' --tags)-development lerna run --stream --parallel start",
"start:cloud": "REACT_APP_VERSION=$(git fetch origin --tags -q && git describe --dirty --match '[0-9]*' --tags)-cloudDevelopment lerna run --stream --parallel start:cloud",
"start:prod": "lerna run --stream --parallel start:prod",
"test": "lerna run test"
},
"workspaces": {
Expand Down
5 changes: 3 additions & 2 deletions enclave-manager/web/packages/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@
"scripts": {
"analyze": "source-map-explorer 'build/static/js/*.js'",
"clean": "rm -rf build",
"start": "PORT=4000 craco start",
"start:cloud": "BROWSER=none PUBLIC_URL=http://localhost:3000/emui-dev PORT=4000 dotenv -e ./.env.cloudDevelopment -- craco start",
"waitForComponentsBuild": "scripts/wait-until-file-exists.sh ../components/build/index.js",
"start": "yarn waitForComponentsBuild && PORT=4000 craco start",
"start:cloud": "yarn waitForComponentsBuild && BROWSER=none PUBLIC_URL=http://localhost:3000/emui-dev PORT=4000 dotenv -e ./.env.cloudDevelopment -- craco start",
"start:prod": "serve -p 4000 -s build",
"build": "craco build",
"test": "craco test",
Expand Down
40 changes: 40 additions & 0 deletions enclave-manager/web/packages/app/scripts/wait-until-file-exists.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/usr/bin/env bash
# 2021-07-08 WATERMARK, DO NOT REMOVE - This script was generated from the Kurtosis Bash script template

set -euo pipefail # Bash "strict mode"

# ==================================================================================================
# Arg Parsing & Validation
# ==================================================================================================
show_helptext_and_exit() {
echo "Usage: $(basename "${0}") file_name"
echo ""
echo " file_name The file to wait to exist"
echo ""
exit 1 # Exit with an error so that if this is accidentally called by CI, the script will fail
}

file_name="${1:-}"

if [ -z "${file_name}" ]; then
echo "Error: No file to wait for provided" >&2
show_helptext_and_exit
fi

# ==================================================================================================
# Main Logic
# ==================================================================================================
# Block until the given file appears or the given timeout is reached.
# Exit status is 0 iff the file exists.
wait_file() {
local file="$1"; shift
local wait_seconds="${1:-30}"; shift # 30 seconds as default timeout
test $wait_seconds -lt 1 && echo 'At least 1 second is required' && return 1

until test $((wait_seconds--)) -eq 0 -o -e "$file" ; do sleep 1; done

test $wait_seconds -ge 0 # equivalent: let ++wait_seconds
}

wait_file "$file_name" 30
exit 0
1 change: 1 addition & 0 deletions enclave-manager/web/packages/components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
},
"homepage": "https://github.com/kurtosis-tech/kurtosis",
"scripts": {
"start": "tsc --watch --preserveWatchOutput",
"build": "rm -rf build/; tsc"
},
"eslintConfig": {
Expand Down

0 comments on commit 197381f

Please sign in to comment.