Skip to content

Commit

Permalink
feat: Improve installers to install all scripts in bin directory
Browse files Browse the repository at this point in the history
Rather than explicitly installing (via symbolic links) the shell scripts in the bin
directories, we enhance the installers to loop over all the *.sh files in those
directories and install all that are found.

This will more gracefully handle all future scripts that are added to the bin directory to
automatically be included in the installation process.
  • Loading branch information
joshuacurtiss committed Feb 24, 2025
1 parent 6fa2a7b commit 532e857
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
4 changes: 3 additions & 1 deletion centos-7/docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ elif [ -d '/usr/local/bin' ]; then
bin_dir='/usr/local/bin'
fi
if [ -n "$bin_dir" ]; then
ln -f -s "$(realpath "$scr_dir/../shared/bin/deploy.sh")" "$bin_dir/deploy"
for scr_name in "$scr_dir"/../shared/bin/*.sh; do
ln -f -s "$(realpath "$scr_name")" "$bin_dir/$(basename "$scr_name" .sh)"
done
fi

# Start/Enable Docker
Expand Down
4 changes: 3 additions & 1 deletion macos/docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,7 @@ if [ -d '/usr/local/bin' ]; then
bin_dir='/usr/local/bin'
fi
if [ -n "$bin_dir" ]; then
ln -f -s "$(realpath "$scr_dir/../shared/bin/deploy.sh")" "$bin_dir/deploy"
for scr_name in "$scr_dir"/../shared/bin/*.sh; do
ln -f -s "$(realpath "$scr_name")" "$bin_dir/$(basename "$scr_name" .sh)"
done
fi
9 changes: 6 additions & 3 deletions rhel-9/docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,12 @@ elif [ -d '/usr/local/bin' ]; then
bin_dir='/usr/local/bin'
fi
if [ -n "$bin_dir" ]; then
ln -f -s "$(realpath "$scr_dir/../shared/bin/deploy.sh")" "$bin_dir/deploy"
ln -f -s "$scr_dir/bin/docker-compose.sh" "$bin_dir/docker-compose"
ln -f -s "$scr_dir/bin/podman-install-service.sh" "$bin_dir/podman-install-service"
for scr_name in "$scr_dir"/../shared/bin/*.sh; do
ln -f -s "$(realpath "$scr_name")" "$bin_dir/$(basename "$scr_name" .sh)"
done
for scr_name in "$scr_dir"/bin/*.sh; do
ln -f -s "$(realpath "$scr_name")" "$bin_dir/$(basename "$scr_name" .sh)"
done
fi

# Silence Docker emulation messages
Expand Down

0 comments on commit 532e857

Please sign in to comment.