https://kotlinlang.org logo
kudos to @jmfayard and @Nikky 🙂
n

Nikky

03/09/2022, 7:47 AM
never tried to use underscores in files in this context, i can try that in a minute
p

Piotr Krzemiński

03/09/2022, 7:48 AM
ok, my goal was to place this script at the top of file lists, so that it's not mixed with workflows. Maybe another character could give similar result and work, but it's still interesting to check why the underscore doesn't work 🤔
what's interesting, it works fine on GitHub 🙂
n

Nikky

03/09/2022, 7:51 AM
i just tried scriptfile
_test___workflow.main.kts
generating
_test_workflow.yaml
and it works fine (on linux)
p

Piotr Krzemiński

03/09/2022, 7:52 AM
so weird... maybe Kotlin compiler caches contents of the scripts? could you now rename the file and see if it catches the rename?
n

Nikky

03/09/2022, 7:55 AM
it certainly failed a few times because in my scripts i am importing function from a object in itself (because scripting is picky about top level functions) but the output is as expected once it worked..
p

Piotr Krzemiński

03/09/2022, 8:07 AM
ok, thanks for checking, I'll play with it later
some other changes than in
sourceFile
are also not taken into account, so it looks like some kind of Kotlin caching misbehaves
+1 please, will help with visibility 😄