Skip to content

Commit 23d5180

Browse files
authored
Merge pull request #321 from rnhurt/master
Make stack-diff output prettier
2 parents 3a765d0 + 4e9d717 commit 23d5180

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,11 @@ postgres02 DELETE_COMPLETE 2011-05-23T15:47:44Z NEVER_UPDATED NOT_NESTED
148148
* [bash](https://www.gnu.org/software/bash/)
149149
* [jq-1.4](http://stedolan.github.io/jq/download/) or later (for stack-diff)
150150

151+
### Optional Packages
152+
153+
* [colordiff](https://www.colordiff.org/) to show stack-diff in color
154+
* [icdiff](https://github.com/jeffkaufman/icdiff) to show stack-diff in color and side-by-side
155+
151156
### Installation
152157

153158
As shown below, you may simply clone the GitHub repo and source the files required.

lib/stack-functions

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -840,7 +840,9 @@ _bma_stack_diff_template() {
840840
if ! aws cloudformation describe-stacks --stack-name "$stack" 1>/dev/null; then
841841
return 1;
842842
fi
843-
if [ "x$( type -P colordiff )" != "x" ]; then
843+
if command -v icdiff; then
844+
local DIFF_CMD=icdiff
845+
elif command -v colordiff; then
844846
local DIFF_CMD=colordiff
845847
else
846848
local DIFF_CMD=diff
@@ -876,7 +878,9 @@ _bma_stack_diff_params() {
876878
if [ ! -f "$params" ]; then
877879
return 1
878880
fi
879-
if [ "x$( type -P colordiff )" != "x" ]; then
881+
if command -v icdiff; then
882+
local DIFF_CMD=icdiff
883+
elif command -v colordiff; then
880884
local DIFF_CMD=colordiff
881885
else
882886
local DIFF_CMD=diff

0 commit comments

Comments
 (0)