Skip to content

Commit

Permalink
Fixed issue where up, start, down and stop would exit with an error o…
Browse files Browse the repository at this point in the history
…n env types not using Mutagen sessions

Due to changes made to implement #90 failing to account for env types not using sync sessions, these commands would exit with the following error and a non-zero exit code:

Mutagen configuration does not exist for environment type "magento1"
  • Loading branch information
davidalger committed Mar 7, 2020
1 parent 283c73d commit 9e7ac7b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
## UNRELEASED [x.y.z](https://github.com/davidalger/warden/tree/x.y.z) (yyyy-mm-dd)
[All Commits](https://github.com/davidalger/warden/compare/0.3.0..develop)

**Bug Fixes:**

* Fixed issue where `env up` and `env start` would exit with an error on env types not using Mutagen sessions
* Fixed issue where `env down` and `env stop` would exit with an error on env types not using Mutagen sessions

## Version [0.3.0](https://github.com/davidalger/warden/tree/0.3.0) (2020-03-06)
[All Commits](https://github.com/davidalger/warden/compare/0.2.4..0.3.0)

Expand Down
4 changes: 2 additions & 2 deletions commands/env.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -98,15 +98,15 @@ docker-compose \

## start mutagen sync if needed
if ([[ "${WARDEN_PARAMS[0]}" == "up" ]] || [[ "${WARDEN_PARAMS[0]}" == "start" ]]) \
&& [[ $OSTYPE =~ ^darwin ]] \
&& [[ $OSTYPE =~ ^darwin ]] && [[ -f "${WARDEN_DIR}/environments/${WARDEN_ENV_TYPE}.mutagen.yml" ]] \
&& [[ $(warden sync list | grep -i 'Connection state: Connected' | wc -l | awk '{print $1}') != "2" ]]
then
warden sync start
fi

## stop mutagen sync if needed
if ([[ "${WARDEN_PARAMS[0]}" == "down" ]] || [[ "${WARDEN_PARAMS[0]}" == "stop" ]]) \
&& [[ $OSTYPE =~ ^darwin ]]
&& [[ $OSTYPE =~ ^darwin ]] && [[ -f "${WARDEN_DIR}/environments/${WARDEN_ENV_TYPE}.mutagen.yml" ]]
then
warden sync stop
fi
1 change: 1 addition & 0 deletions commands/sync.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

source "${WARDEN_DIR}/utils/core.sh"
source "${WARDEN_DIR}/utils/env.sh"

WARDEN_ENV_PATH="$(locateEnvPath)" || exit $?
loadEnvConfig "${WARDEN_ENV_PATH}" || exit $?

Expand Down

0 comments on commit 9e7ac7b

Please sign in to comment.