News for hackers. Stuff that matters.
Re:The Bun Shell by jftuga on Saturday January 20, 2024 @08:58PM (#39074724)
Their info about "rm -rf" not working in Windows is slightly misleading. In PowerShell, you can accomplish this by running:

rm -r -fo my-folder-name

Re:The Bun Shell by ARandomerDude on Saturday January 20, 2024 @09:16PM (#39074838)
How many Linux/Mac devs know that? We live in a left-pad world, of course people will install a package to get a simple job done.
Re:The Bun Shell by charrondev on Saturday January 20, 2024 @11:01PM (#39075411)
This is mostly useful to developers that don’t develop on windows. Typically server side and browser based JavaScript programs are deployed on Linux systems in production.

Today if I want to reliably automate some scripting I do NOT use shell scripting because it makes a bunch of implicit dependencies on existing system.

Instead I write these utility scripts in either JavaScript or PHP depending on the project and this seems to give JavaScript a slightly nicer consistent interface to perform basic functionality, built directly into the runtime.

Re:The Bun Shell by aarjithn on Saturday January 20, 2024 @10:13PM (#39075177)
Well, it’s still not “rm -rf” right? Why is it misleading then?

A typical problem of this is when having to run a script (say rm -rf dist) in windows and mac systems not the command itself

Re:The Bun Shell by Gabrys1 on Sunday January 21, 2024 @03:55AM (#39076797)
The reason I used rimraf was it was a way to make JS delete all files in the directory. Why would I need to think to shell out to "rm -rf dir" and be responsible for argument escaping, error handling, different shells, etc. If that's what the library does, ok, but it can do it in any way the library devs decided was best. I offloaded that decision to them (putting more trust in them to do it right than in myself).