Skip to content

Commit

Permalink
Simplified local ahoy imports.
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexSkrypnyk committed Sep 5, 2024
1 parent 686e70e commit 61fd888
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 14 deletions.
10 changes: 3 additions & 7 deletions .ahoy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -262,13 +262,9 @@ commands:
local:
usage: Custom local commands. See `ahoy local help`.
cmd: |
if [ -f .ahoy.local.yml ]; then
ahoy -f ".ahoy.local.yml" "$@"
else
echo ".ahoy.local.yml does not exist."
echo "Copy .ahoy.local.example.yml to .ahoy.local.yml and rerun this command.";
fi
optional: true
imports:
- .ahoy.local.yml

# ----------------------------------------------------------------------------
# Utilities.
Expand Down
8 changes: 1 addition & 7 deletions .vortex/tests/bats/workflow.utilities.bats
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,16 @@ load _helper.workflow.bash
step "Run ahoy local commands"

substep "Assert calling local commands without local file does not throw error"
run ahoy local
run ahoy --version
assert_success
assert_output_not_contains "[fatal]"
assert_output_contains ".ahoy.local.yml does not exist."
assert_output_contains "Copy .ahoy.local.example.yml to .ahoy.local.yml and rerun this command."

substep "Assert calling local commands with local file path specified and file is present works correctly"
cp ".ahoy.local.example.yml" ".ahoy.local.yml"
run ahoy local help
assert_success
assert_output_contains "Custom local commands"
assert_output_not_contains "[fatal]"
assert_output_not_contains ".ahoy.local.yml does not exist."
assert_output_not_contains "Copy .ahoy.local.example.yml to .ahoy.local.yml and rerun this command."

substep "Assert calling local commands with local file path specified and file is present and file return non-zero exit code"

Expand All @@ -41,8 +37,6 @@ load _helper.workflow.bash
assert_failure
assert_output_contains "expected failure"
assert_output_not_contains "[fatal]"
assert_output_not_contains ".ahoy.local.yml does not exist."
assert_output_not_contains "Copy .ahoy.local.example.yml to .ahoy.local.yml and rerun this command."
}

@test "Doctor info" {
Expand Down

1 comment on commit 61fd888

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.