Skip to content

Commit c4751c3

Browse files
tomowatttoote
andauthored
refactor: simply builder_remove_args array construction and usage
Co-authored-by: Matías Bellone <toote@users.noreply.github.com>
1 parent fbd6bef commit c4751c3

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

hooks/pre-exit

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ builder_remove="$(plugin_read_config BUILDER_REMOVE "false")"
2828
if [[ "${builder_remove}" == true ]]; then
2929
if builder_instance_exists "${builder_name}"; then
3030

31-
builder_remove_args=()
31+
builder_remove_args=("${builder_name}")
3232

3333
if [[ "$(plugin_read_config BUILDER_KEEP_DAEMON "false")" == "true" ]]; then
3434
builder_remove_args+=("--keep-daemon")
@@ -40,7 +40,7 @@ if [[ "${builder_remove}" == true ]]; then
4040

4141
echo "~~~ :docker: Cleaning up Builder Instance '${builder_name}'"
4242
docker buildx stop "${builder_name}"
43-
docker buildx rm "${builder_name}" ${builder_remove_args:+${builder_remove_args[@]}}
43+
docker buildx rm "${builder_remove_args[@]}"
4444
else
4545
echo "~~~ :warning: Cannot remove Builder Instance '${builder_name}' as does not exist"
4646
fi

0 commit comments

Comments
 (0)