From 97348b1c9d7c92ed3736ff9606bc492957167f78 Mon Sep 17 00:00:00 2001 From: Dean Sheather Date: Sun, 19 Jun 2022 13:15:20 -0500 Subject: [PATCH] fix: replace underscores with hyphens in slim binary name (#2509) --- scripts/build_go_slim.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/scripts/build_go_slim.sh b/scripts/build_go_slim.sh index 6b4e041402..851aecd85e 100755 --- a/scripts/build_go_slim.sh +++ b/scripts/build_go_slim.sh @@ -83,7 +83,12 @@ dest_dir="$(realpath "$dest_dir")" # Copy the binaries to the site directory. cd "$(dirname "$output_path")" for f in ./coder-slim_*; do - f="${f#./}" - dest="$dest_dir/${f//-slim_$version/}" + # Remove ./ prefix + name="${f#./}" + # Remove "-slim_$version" + truncated="${name//-slim_$version/}" + # Replace underscores with hyphens + hyphenated="${truncated//_/-}" + dest="$dest_dir/$hyphenated" cp "$f" "$dest" done