Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: util.scandir borked on OS X #96

Open
p3r7 opened this issue Nov 23, 2023 · 1 comment
Open

bug: util.scandir borked on OS X #96

p3r7 opened this issue Nov 23, 2023 · 1 comment

Comments

@p3r7
Copy link
Contributor

p3r7 commented Nov 23, 2023

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:

  • drop the --group-directories-first flag (meh as we'd loose feature parity w/ norns)
  • have coreutils be a dependency to seamstress on OS X and call gls instead of ls
  • use an alternative method, such as successive calls to find (per this rec)

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
Copy link
Owner

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...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants