Skip to content

Commit

Permalink
Merge pull request #676 from flpandre/feature/overwrite-commands
Browse files Browse the repository at this point in the history
Introduce ability to overwrite commands
  • Loading branch information
navarr authored Jul 14, 2023
2 parents 7552701 + 1bca12d commit 8873eef
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions bin/warden
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,7 @@ if (( "$#" )); then
## local project directory if running within one; don't fail if it can't be found
WARDEN_ENV_PATH="$(locateEnvPath 2>/dev/null)" || true

if [[ -f "${WARDEN_DIR}/commands/${1}.cmd" ]]; then
WARDEN_CMD_VERB="$1"
WARDEN_CMD_EXEC="${WARDEN_DIR}/commands/${1}.cmd"
WARDEN_CMD_HELP="${WARDEN_DIR}/commands/${1}.help"
shift
elif [[ -f "${WARDEN_ENV_PATH}/.warden/commands/${1}.cmd" ]]; then
if [[ -f "${WARDEN_ENV_PATH}/.warden/commands/${1}.cmd" ]]; then
WARDEN_CMD_VERB="$1"
WARDEN_CMD_ANYARGS+=("$1")
WARDEN_CMD_EXEC="${WARDEN_ENV_PATH}/.warden/commands/${1}.cmd"
Expand All @@ -69,6 +64,11 @@ if (( "$#" )); then
WARDEN_CMD_EXEC="${WARDEN_HOME_DIR}/commands/${1}.cmd"
WARDEN_CMD_HELP="${WARDEN_HOME_DIR}/commands/${1}.help"
shift
elif [[ -f "${WARDEN_DIR}/commands/${1}.cmd" ]]; then
WARDEN_CMD_VERB="$1"
WARDEN_CMD_EXEC="${WARDEN_DIR}/commands/${1}.cmd"
WARDEN_CMD_HELP="${WARDEN_DIR}/commands/${1}.help"
shift
else
WARDEN_HELP=1
fi
Expand Down

0 comments on commit 8873eef

Please sign in to comment.