4 ms·
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
by jftuga 3y ago
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
- ARandomerDude 3y agoHow 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.
- charrondev 3y agoThis 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.
- aarjithn 3y agoWell, 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
- Gabrys1 3y agoThe 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).