-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
269 additions
and
364 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
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,35 @@ | ||
#!/bin/bash | ||
set -ex | ||
|
||
SCRIPTNAME=${0##*/} | ||
|
||
echo " - jest version:" $(./node_modules/.bin/jest --version || { echo "$SCRIPTNAME: jest is not available"; exit 1; }) | ||
echo " - nodemon version:" $(./node_modules/.bin/nodemon --version || { echo "$SCRIPTNAME: nodemon is not available"; exit 1; }) | ||
|
||
if [ "$1" = "" ]; then | ||
echo "You need to pass a command to run." | ||
exit 1 | ||
fi | ||
|
||
if [ "$1" != "jest" ] && [ "$1" != "dev-server" ]; then | ||
echo "An argument for the command has invalid value '$1'. Available options: jest, dev-server." | ||
exit 1 | ||
fi | ||
|
||
ENV_VALUE="" | ||
|
||
if [ "$1" = "jest" ]; then | ||
ENV_VALUE="test" | ||
CMD="./node_modules/.bin/jest" | ||
|
||
if [ "$2" = "--watch" ]; then | ||
CMD="./node_modules/.bin/jest --watch" | ||
fi | ||
fi | ||
|
||
if [ "$1" = "dev-server" ]; then | ||
CMD="./node_modules/.bin/nodemon index.js" | ||
fi | ||
|
||
ENV=$ENV_VALUE \ | ||
$CMD |
Oops, something went wrong.