@@ -134,9 +134,9 @@ stack-update() {
134
134
135
135
stack-delete () {
136
136
local inputs=$( __bma_read_inputs $@ )
137
- local first_resource=$( __bma_read_resources ${inputs} | awk ' {print $1} ' )
137
+ local first_resource=$( __bma_read_resources ${inputs} | head -1 )
138
138
local stack=$( _stack_name_arg $first_resource )
139
- [[ -z ${stack} ]]; __bma_usage " stack" && return 1
139
+ [[ -z " ${stack} " ]] && __bma_usage " stack" && return 1
140
140
141
141
if aws cloudformation delete-stack --stack-name $stack ; then
142
142
stack-tail $stack
@@ -146,10 +146,9 @@ stack-delete() {
146
146
stack-failure () {
147
147
# FIXME: only grab the latest failure
148
148
local inputs=$( __bma_read_inputs $@ )
149
- local first_resource=$( __bma_read_resources ${inputs} | awk ' {print $1} ' )
149
+ local first_resource=$( __bma_read_resources ${inputs} | head -1 )
150
150
local stack=$( _stack_name_arg $first_resource )
151
-
152
- if [[ -z ${stack} ]]; then __bma_error " Usage: $FUNCNAME stack" || return 1; fi
151
+ [[ -z " ${stack} " ]] && __bma_usage " stack" && return 1
153
152
154
153
local query='
155
154
StackEvents[?contains(ResourceStatus,`FAILED`)].[
@@ -168,7 +167,7 @@ stack-failure() {
168
167
169
168
stack-events () {
170
169
local inputs=$( __bma_read_inputs $@ )
171
- local first_resource=$( __bma_read_resources ${inputs} | awk ' {print $1} ' )
170
+ local first_resource=$( __bma_read_resources ${inputs} | head -1 )
172
171
local stack=$( _stack_name_arg $first_resource )
173
172
[[ -z ${stack} ]] && __bma_usage " stack" && return 1
174
173
@@ -194,7 +193,7 @@ stack-events() {
194
193
195
194
stack-resources () {
196
195
local inputs=$( __bma_read_inputs $@ )
197
- local stack=$( __bma_read_resources ${inputs} | awk ' {print $1} ' )
196
+ local stack=$( __bma_read_resources ${inputs} | head -1 )
198
197
[[ -z ${stack} ]] && __bma_usage " stack" && return 1
199
198
200
199
local query=' StackResources[].[ PhysicalResourceId, ResourceType ]'
@@ -222,7 +221,7 @@ stack-instances() {
222
221
223
222
stack-parameters () {
224
223
local inputs=$( __bma_read_inputs $@ )
225
- local stack=$( __bma_read_resources ${inputs} | awk ' {print $1} ' )
224
+ local stack=$( __bma_read_resources ${inputs} | head -1 )
226
225
[[ -z ${stack} ]] && __bma_usage " stack" && return 1
227
226
228
227
local query='
0 commit comments