Skip to content

Commit

Permalink
Retain benthos as the binary name
Browse files Browse the repository at this point in the history
Signed-off-by: Mihai Todor <[email protected]>
  • Loading branch information
mihaitodor committed Aug 26, 2024
1 parent 54c1546 commit bee003d
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions bin/install
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ install_benthos() {
# Which OS and version? #
#########################

benthos_bin="redpanda-connect"
redpanda_connect_bin="redpanda-connect"
benthos_bin="benthos"
benthos_dl_ext=".tar.gz"

# NOTE: `uname -m` is more accurate and universal than `arch`
Expand Down Expand Up @@ -110,6 +111,7 @@ install_benthos() {
# Should catch cygwin
sudo_cmd=""
benthos_os="windows"
redpanda_connect_bin=$redpanda_connect_bin.exe
benthos_bin=$benthos_bin.exe
else
echo "Aborted, unsupported or unknown os: $unameu"
Expand All @@ -132,16 +134,16 @@ install_benthos() {

echo "Extracting..."
case "$benthos_file" in
*.tar.gz) tar -xzf "$dl" -C "$PREFIX/tmp/" "$benthos_bin" ;;
*.tar.gz) tar -xzf "$dl" -C "$PREFIX/tmp/" "$redpanda_connect_bin" ;;
esac
chmod +x "$PREFIX/tmp/$benthos_bin"
chmod +x "$PREFIX/tmp/$redpanda_connect_bin"

echo "Putting benthos in $benthos_install_path (may require password)"
if [ -n "$sudo_cmd" ] && [ -n "$(find "$benthos_install_path" -prune -user "$(id -u)")" ]; then
# Skip sudo if the current user is the owner of the Benthos install path
sudo_cmd=""
fi
$sudo_cmd mv "$PREFIX/tmp/$benthos_bin" "$benthos_install_path/$benthos_bin"
$sudo_cmd mv "$PREFIX/tmp/$redpanda_connect_bin" "$benthos_install_path/$benthos_bin"
$sudo_cmd rm -- "$dl"

# check installation
Expand Down

0 comments on commit bee003d

Please sign in to comment.