-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Displays command line on failure (#50)
- Loading branch information
1 parent
0cede41
commit 0e59a65
Showing
3 changed files
with
41 additions
and
16 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 |
---|---|---|
@@ -1,13 +1,28 @@ | ||
#!/usr/bin/env bash | ||
|
||
display_command() { | ||
local script_name="$1" | ||
local ansible_role="$2" | ||
local vagrant_box="$3" | ||
local pre_script="$4" | ||
local enable_vbguest=$5 | ||
|
||
warning "This test has failed. You can rerun it with the following command" | ||
|
||
>&2 printf '%s --verbose --ansible-role "%s" --vagrant-box "%s"' "${script_name}" "${ansible_role}" "${vagrant_box}" | ||
[ -n "${pre_script}" ] && >&2 printf ' --pre-script "%s"' "${pre_script}" | ||
${enable_vbguest} && >&2 printf ' --enable-vbguest' | ||
>&2 printf "\n" | ||
} | ||
|
||
error() { | ||
local message="$1" | ||
|
||
>&2 printf "\e[1;91m%s\e[0m\n\n" "${message}" | ||
>&2 printf "\e[1;91m%s\e[0m\n" "${message}" | ||
} | ||
|
||
warning() { | ||
local message="$1" | ||
|
||
>&2 printf "\e[1;93m%s\e[0m\n\n" "${message}" | ||
>&2 printf "\e[1;93m%s\e[0m\n" "${message}" | ||
} |
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