From 99045bf64cf136df3c0d7d3775a64cc41268a0ed Mon Sep 17 00:00:00 2001 From: Malfurious Date: Sat, 12 Aug 2023 02:50:17 -0400 Subject: acid: build: Fix bug in cychedelic project-name generation The nested single quotes in these variables were not being interpreted correctly at their usage locations (the quoted project name was being sent to the docker cli). The quotes were initially wanted for the case where there is not yet any previous_slug, as the command "docker compose --project-name down" is ill-formed. Since we know the actual slug values will not contain spaces, we can do away with the quotes. Instead, prevent $prev from containing any content in the special case described above. This is accomplished by the conditional check [ -n "$prev" ]. Signed-off-by: Malfurious --- acid/cyche-build | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/acid/cyche-build b/acid/cyche-build index 586e230..4239340 100755 --- a/acid/cyche-build +++ b/acid/cyche-build @@ -25,9 +25,11 @@ cd "/services/$1" if [ "$3" == "--self" ]; then + prev=$(cat '.git/previous_slug') + [ -n "$prev" ] && prev="--project-name $prev" + slug=$(echo -n "$1-"; tr -dc a-z