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

This commit is contained in:
Dean Sheather 2022-06-19 13:15:20 -05:00 committed by GitHub
parent 8d6faa3c1a
commit 97348b1c9d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 2 deletions

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