fix: replace underscores with hyphens in slim binary name (#2509)

This commit is contained in:
Dean Sheather
2022-06-19 18:15:20 +00:00
committed by GitHub
parent 8d6faa3c1a
commit 97348b1c9d
+7 -2
View File
@@ -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