-
-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #49 from ahoy-cli/dev-47-init-script
Fixes Issue #47
- Loading branch information
Showing
13 changed files
with
134 additions
and
44 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -2,3 +2,4 @@ | |
docs/_build | ||
# Ignore the ahoy binary when it's built | ||
ahoy | ||
.idea |
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
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
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
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
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
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 @@ | ||
export TEST1=test1 |
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
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,12 @@ | ||
ahoyapi: v2 | ||
entrypoint: | ||
- bash | ||
- "-x" | ||
- "-c" | ||
- '{{cmd}}' | ||
- '{{name}}' | ||
|
||
commands: | ||
echo: | ||
cmd: | | ||
echo "$@" |
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,7 @@ | ||
ahoyapi: v2 | ||
entrypoint: [php, "-r", '{{cmd}}'] | ||
commands: | ||
echo: | ||
cmd: | | ||
array_shift($argv); | ||
print(implode(" ", $argv) . "\n"); |
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,15 @@ | ||
ahoyapi: v2 | ||
entrypoint: | ||
- "bash" | ||
- "-c" | ||
- | | ||
source ./config.sh | ||
bash -c "$0" "$@" | ||
- '{{cmd}}' | ||
- '{{name}}' | ||
|
||
commands: | ||
echo-test: | ||
cmd: | | ||
ls "$@" | ||
echo $TEST1 |
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
ahoyapi: v2 | ||
commands: | ||
echo: | ||
cmd: echo {{args}} | ||
cmd: echo "$@" |
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,19 @@ | ||
#!/usr/bin/env bats | ||
|
||
@test "override bash entrypoint to add additional flags" { | ||
run ./ahoy -f testdata/entrypoint-bash.ahoy.yml echo something | ||
[ $status -eq 0 ] | ||
echo "$output" | ||
[ "${#lines[@]}" -eq 2 ] | ||
[ "${lines[0]}" == "+ echo something" ] | ||
[ "${lines[1]}" == "something" ] | ||
|
||
} | ||
|
||
@test "override bash entrypoint to use php instead" { | ||
run ./ahoy -f testdata/entrypoint-php.ahoy.yml echo something | ||
[ $status -eq 0 ] | ||
echo "$output" | ||
[ "${#lines[@]}" -eq 1 ] | ||
[ "${lines[0]}" == "something" ] | ||
} |