Yes you can use from squint but also directly from JS without any compilation
Since it's available on NPM now
I'm not sure if it's a good idea but I started playing around with porting babashka.fs to Node.js (CLJS + Squint). Sometimes I need some file operations in Node and I don't want to read the Node.js docs to do it since I don't use it that often... A similar problem I have with bash ;)
One caveat is that all of these functions will use Node's Sync variants since babashka.fs on the JVM is synchronous
But for the things I build with it (squint's I/O when doing compilation for example) that would be fine
supporting js engine stuff is always a good idea 🙂 this is for nbb, correkt?
not just for nbb, but yes, I could include it in nbb
Oh wow
For Windows users in this channel, is openssl usually on your system's PATH? What does (babashka.fs/which "openssl") return?
For Me:
cmd:
C:\Users\seanc>openssl
'openssl' is not recognized as an internal or external command,
operable program or batch file.
and using bb per your question returns nil.
Similarly on Powershell.Do you have Git bash on Windows?
No, I've always hated git bash 😞
ok fine. I read somewhere that git bash includes openssl on the path. how hard it is to install it from scratch? would be useful to know since we're giving a workshop at the conj and we need to shell out to openssl :)
I honestly thought MS had started including openssl as standard but maybe that's only on new installs of Windows? My original install is from years ago and I've just been upgrading all the time...
winget install openssl should be all you need (at least on a modern Windows system)
did you test it?
Well... it installs it... somewhere... but doesn't put it on the PATH...
The docs around that winget command indicate it should add it to the System Path automatically but it didn't seem to... (but I'm not very familiar with Windows so I may be holding it wrong).
perhaps you need to restart your shell (or system... )?
Ah, it does not update PATH. It installs to C:\Program Files\OpenSSL-Win64\bin and then you have to add that to your PATH var...
thanks for the info
Yup, confirmed that works:
• run winget install openssl
• use control panel to edit environment variables
• under System select Path and Edit...
• add New... with C:\Program Files\OpenSSL-Win64\bin
• start a new cmd or Powershell window
• openssl works!
C:\Users\seanc>bb
Babashka v1.12.218
Type :repl/help for help
user=> (require 'babashka.fs)
nil
user=> (babashka.fs/which "openssl")
#object[sun.nio.fs.WindowsPath 0x183bfadf "C:\\Program Files\\OpenSSL-Win64\\bin\\openssl.exe"]
user=>👍
If you need another data point, I also don't have openssl in my path even though I have Git Bash.
did you check inside git bash?
and can you try Sean's instructions to see if that works properly for you?
there I do have it, yes
yeah ok