Skip to content

Commit

Permalink
Merge pull request #1 from erento/update/nest-v5
Browse files Browse the repository at this point in the history
chore: update to nestjs@v5
  • Loading branch information
FlorianTopf authored May 17, 2018
2 parents b959ffe + 089faa5 commit ce53668
Show file tree
Hide file tree
Showing 19 changed files with 269 additions and 364 deletions.
File renamed without changes.
File renamed without changes.
35 changes: 35 additions & 0 deletions dev-env.sh
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
Loading

0 comments on commit ce53668

Please sign in to comment.