dktr0 / estuary

Platform for collaboration and learning through live coding
GNU General Public License v3.0
165 stars 27 forks source link

generateAudioResources.sh can't handle directories with spaces #208

Open cleary opened 2 years ago

cleary commented 2 years ago

The $1 needs to be quoted with find:

diff --git a/generateAudioResources.sh b/generateAudioResources.sh
index 920ed529..5b661b18 100755
--- a/generateAudioResources.sh
+++ b/generateAudioResources.sh
@@ -1,7 +1,7 @@
 #/bin/sh
 printf "[\n"
 dircount=0
-find $1 -mindepth 1 -maxdepth 1 -iname "*" | sort | while read d; do
+find "$1" -mindepth 1 -maxdepth 1 -iname "*" | sort | while read d; do
   if [ -d "$d" ]
   then
     dirname=`basename $d`
dktr0 commented 2 years ago

Thanks - however what do you think the end result of directories with spaces should be? MiniTidal for example does not particularly support sample bank names that have spaces in them...?

dktr0 commented 2 years ago

I guess this isn't about the individual sample bank names though, is it - just the name of the folder at the top of the search which doesn't show up in the reslist at all, right?

cleary commented 2 years ago

I guess this isn't about the individual sample bank names though, is it - just the name of the folder at the top of the search which doesn't show up in the reslist at all, right?

Correct 🙂

As for what should happen with sample folder names (or sample names) with spaces, good question - my gut feel is just a warning to stderr that it won't be included?

dktr0 commented 2 years ago

Yeah that sounds good.