Skip to content
This repository was archived by the owner on Jul 2, 2024. It is now read-only.

Commit c56bfbf

Browse files
committed
Merge pull request #20 from jdeathe/issue/9
ISSUE 9: Use local variable scope for BASH helper functions.
2 parents 51d63de + 49f542e commit c56bfbf

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

build.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ source build.conf
1212

1313
show_docker_image ()
1414
{
15-
NAME=$1
16-
NAME_PARTS=(${NAME//:/ })
15+
local NAME=$1
16+
local NAME_PARTS=(${NAME//:/ })
1717

1818
# Set 'latest' tag if no tag requested
1919
if [ ${#NAME_PARTS[@]} == 1 ]; then

run.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ fi
1919

2020
have_docker_container_name ()
2121
{
22-
NAME=$1
22+
local NAME=$1
2323

2424
if [[ -n $(docker ps -a | awk -v pattern="^${NAME}$" '$NF ~ pattern { print $NF; }') ]]; then
2525
return 0
@@ -30,7 +30,7 @@ have_docker_container_name ()
3030

3131
is_docker_container_name_running ()
3232
{
33-
NAME=$1
33+
local NAME=$1
3434

3535
if [[ -n $(docker ps | awk -v pattern="^${NAME}$" '$NF ~ pattern { print $NF; }') ]]; then
3636
return 0
@@ -41,7 +41,7 @@ is_docker_container_name_running ()
4141

4242
remove_docker_container_name ()
4343
{
44-
NAME=$1
44+
local NAME=$1
4545

4646
if have_docker_container_name ${NAME} ; then
4747
if is_docker_container_name_running ${NAME} ; then

0 commit comments

Comments
 (0)