monome / norns

norns is many sound instruments.
http://monome.org
GNU General Public License v3.0
633 stars 147 forks source link

Lua files in dust/code/crow are shown in script listing #1739

Closed xmacex closed 4 months ago

xmacex commented 12 months ago

Hi. With the new update Lua files in directory dust/code/crow are shown in the norns script listing. Loading any of them on norns will probably fail.

crows_are_there.gif

The relevant change seems to have been https://github.com/monome/norns/pull/1712 which moved getting the script listing from Lua to find (1).

Files inside script subfolders called crow e.g. code/murder/crow/caw.lua are hidden, just not the one in code directly e.g. code/crow/caw.lua.

I am filing this as an issue not because dust/code is necessarily a good place to store crow-only code, but because

  1. Loading crow code on norns will probably fail
  2. Before #1712 code/crow/*.lua were recursively hidden, and
  3. I read a clear intent in #1712 to hide Lua files in directories called crow

So maybe this is a non-issue simply to be closed as won't fix. If not, to hide Lua files in dust/crow, I believe removing the leading / from the grep which filters find would do it, because of how find (1) prints its output.

With the following file tree, with caw.lua being a crow code and murder.lua norns code

$ ls -FRm dust/code/
dust/code/:
crow/, murder/

dust/code/crow:
caw.lua

dust/code/murder:
crow/, murder.lua

dust/code/murder/crow:
caw.lua

currently the listing filters out the crow code in script subdirectory crow but not in directory crow.

$ find ~/dust/code/ -mindepth 2 -name .git -prune -o -type f -name "*.lua" -printf "%P\n" | grep -Ev "/(lib|data|crow)/"
murder/murder.lua
crow/caw.lua

while without the leading / in the reverse grep the listing would filter out crow code both subdirectory crow and directory crow.

$ find ~/dust/code/ -mindepth 2 -name .git -prune -o -type f -name "*.lua" -printf "%P\n" | grep -Ev "(lib|data|crow)/"
murder/murder.lua

I am not sure what's a good place for crow only code. Meanwhile, I've moved my own crow files without a norns component from dust/code/crow to dust/crow.

caw have a good day

tehn commented 4 months ago

i think /dust/data/crow would be an appropriate place for crow code not intended to be run on a norns.

this would mean changing bowering --- https://github.com/whimsicalraps/bowering/blob/main/bowering.lua#L20

dndrks commented 4 months ago

@xmacex , curious how these scripts reached dust/code/crow/? were they manually imported there? i ask because bowering bundles all of its crow scripts into a nav-hidden folder and doesn't import any dust/code/crow/bowery/ files.

if these scripts were manually imported, then def recommend all crow-only files live in /dust/data/crow (if you want them to live on norns at all). but maybe i'm misunderstanding? happy to re-open if so!

xmacex commented 4 months ago

They got there simply because I put them there :)

What confused me was that earlier dust/code/crow was hidden (like all paths with "crow" in them), but then with the update it wasn't anymore. That what was this issue was about basically. Makes sense to keep them out of dust/code – they are obviously code, but not that kind of code which is intended to run on norns. All is clearer now caw caw

I'll keep my crow-only code in dust/crow or in dust/data, but in any case out of dust/code.

I like keeping crow code on norns so I can run druid direct on norns, add my own scripts to bowery, and upload them with the bowering norns script.

Thanks, carry on :)