-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Add "Run Core" run configuration for `./runCore` - Added options `--help`, `--silent`, `--cicd`, and `--force` with aliases - Handles both Linux/Mac and Windows paths using cygpath
- Loading branch information
1 parent
8db3c4a
commit 7e5eb7e
Showing
2 changed files
with
69 additions
and
0 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#!/bin/bash | ||
|
||
function cleanup { | ||
kill %1 > /dev/null # Send exit to startTestingEnv | ||
} | ||
|
||
usage="Usage: runCore [--help] [--silent] [--cicd] [--force]" | ||
silent=false | ||
cicd=false | ||
force=false | ||
|
||
# Based on https://stackoverflow.com/a/33826763/11827673 | ||
while [[ "$#" -gt 0 ]]; do | ||
case $1 in | ||
-h|--help) echo "$usage"; exit ;; | ||
-s|--silent) silent=true ;; | ||
-c|--cicd) cicd=true ;; | ||
-f|--force) force=true ;; | ||
*) echo "Unknown parameter passed: $1"; echo "$usage"; exit 1 ;; | ||
esac | ||
shift | ||
done | ||
|
||
if [[ $force = true && -f .testEnvRunning ]]; then | ||
[[ $silent = false ]] && echo "Removing previous testing environment..." | ||
if [[ $cicd = true ]]; then | ||
./utils/cleanTestEnvCicd | ||
else | ||
./utils/cleanTestEnvLocal | ||
fi | ||
fi | ||
|
||
trap cleanup EXIT | ||
|
||
./startTestingEnv --wait --silent & # Run in background | ||
|
||
[[ $silent = false ]] && echo "Waiting for testing environment to start..." | ||
until [[ -f .testEnvRunning ]] | ||
do | ||
sleep 1 | ||
done | ||
[[ $silent = false ]] && echo "Test environment started!" | ||
cp ./temp/config.yaml . | ||
[[ $silent = false ]] && echo "Starting core..." | ||
|
||
classpath="./core/*:./plugin-interface/*" | ||
|
||
if which cygpath > /dev/null; then # Convert path to Windows-style if using Git Bash | ||
classpath="$(cygpath -C ANSI -w -p "${classpath}")" | ||
fi | ||
|
||
java -classpath "${classpath}" io.supertokens.Main ./ DEV |