robbielyman / seamstress

seamstress is an art engine
GNU General Public License v3.0
123 stars 12 forks source link

bug: `util.scandir` borked on OS X #96

Open p3r7 opened 10 months ago

p3r7 commented 10 months ago

hey!

the issue

so util.scandir relies on ls to list files in a directory. but it uses the --group-directories-first option (src) to have directories listed before regular files in the output,. but this flag is only available for the GNU version of ls (OS X comes w/ BSD's version).

paths of resolution

i see 3 ways to fix this:

2 & 3 both require to be able to test the current OS in the Lua layer. idk if seamstress exposes a global w/ that info already or if this is something that would need to be added.

also this fix would be back-ported to norns itself (for allowing to run norns-desktop on OS X, which is something that got discussed recently).

robbielyman commented 9 months ago

i don't really have a strong opinion here – i've never used util.scandir on norns or seamstress. i would like not to make seamstress depend on coreutils, although i suppose it's not onerous.

seamstress could definitely expose the current os itself, but calling uname is right there already...