30 May 2023 |
JD557#8432 | Ah, thanks I'll try it again later, then | 12:17:50 |
31 May 2023 |
Quafadas#7582 | Apologies if I missed this in the docs - couldn't see it, is there a "native" way to read environment variables into a scala-cli script? In mill, you'd use mill-dotenv or similar. Is there a "canonical" solution for scala-cli (other than adding them to the command line)? | 11:42:55 |
Daenyth#7233 | If you're using the typelevel toolkit then (I forget which) either cats-effect or fs2 has an Env api | 13:45:46 |
Daenyth#7233 | and that works cross-platform | 13:45:59 |
Daenyth#7233 | it's cats-effect | 13:46:13 |
Daenyth#7233 | https://typelevel.org/cats-effect/docs/std/env | 13:46:32 |
thanh#9829 | I think they ask about reading a .env as environment variables with scala-cli | 13:47:36 |
thanh#9829 | * I think they ask about using an .env as environment variables with scala-cli | 13:47:52 |
Daenyth#7233 | ah I misunderstood | 13:47:54 |
thanh#9829 | maybe just a just a like export .env && scala-cli run example.scala | 13:48:42 |
thanh#9829 | I just made up export .env but I'm sure there is something like that | 13:49:06 |
Daenyth#7233 | source | 13:49:10 |
Daenyth#7233 | ah and the .env would have to have export statements inside | 13:49:23 |
Daenyth#7233 | so not ideal | 13:49:36 |
Daenyth#7233 | I mean there's also the dotenv shell tool | 13:49:44 |
Daenyth#7233 | or uhhhh direnv? | 13:49:51 |
Daenyth#7233 | I think might be the name | 13:49:55 |
JD557#8432 | The FAQ in that page really got me, I was just about to ask here "why is that wrapped in F?" | 13:50:04 |
Daenyth#7233 | indeed heh | 13:50:17 |
Quafadas#7582 | Yup, this was a good notion: https://stackoverflow.com/questions/72236557/how-do-i-read-a-env-file-from-a-ps1-script
It's interesting working with scala-cli - I need to re-arrange my mental model to make more of it's "cli" nature. | 14:12:12 |
Quafadas#7582 | * Yup, this was a good idea: https://stackoverflow.com/questions/72236557/how-do-i-read-a-env-file-from-a-ps1-script
It's interesting working with scala-cli - I need to re-arrange my mental model to make more of it's "cli" nature. | 14:12:24 |
Quafadas#7582 | * Yup, this was a good idea, thanks: https://stackoverflow.com/questions/72236557/how-do-i-read-a-env-file-from-a-ps1-script
It's interesting working with scala-cli - I need to re-arrange my mental model to make more of it's "cli" nature. | 14:12:32 |
thanh#9829 | * maybe just a just a script like export .env && scala-cli run example.scala | 14:12:54 |
1 Jun 2023 |
carlosedp | Hi all, just found-out I can run JMH benchmarks with scala-cli ... is there a flag to generate jmh json output files? | 15:35:50 |
carlosedp | Answering myself... found you can run with a cmdline flag: scala-cli --jmh simplebench.scala -- -rf json | 15:52:35 |
Daenyth#7233 | that's really cool | 15:57:58 |
carlosedp | The resulting json can be thrown into https://jmh.morethan.io/ which is great! | 17:57:26 |
Daenyth#7233 | Do you put the jmh annotations etc in the .scala file, or does it do automatic stuff | 18:24:48 |
carlosedp | https://gist.github.com/carlosedp/a84ff5a4f74ffe02c558ccab324f0886 | 19:25:55 |
Daenyth#7233 | very cool! | 19:28:09 |