Code that destroyed my Mac Book Pro 😭

The simple back story is that I had to write a script to delete a bunch of unnecessary files. Recently I had to shutdown 35 servers on Digital Ocean that I had set up for a class I was teaching. I wanted to preserve the student's code, so I scp'd all of it to my laptop. However I unnecessarily copied over the node_modules folders as well as a bunch of hidden folders that were full of files. Deleting these manually would of taken forever. Thus I wrote a script. Here is the code that I wrote:

const child_process = require('child_process')
	, fs = require('fs')
	, path = require('path')
;

const unwantedFolders = ['.ssh', '.npm', '.ipynb_checkpoints'
		, '.keras', '.cache', 'code/node_modules', '.ipython'
		, '.nvm', '.local', '.bashrc', '.bash_history']
	, servers = [...'12345']
		.fill([...'1234567'])
		.flat().map((s, i) => `/Users/peach/servers/server${i+1}`)
	, filesToDelete = servers
		.map(s => unwantedFolders.map(u => path.join(s,u)))
		.flat()
;

filesToDelete.forEach(file => {
	child_process.exec(`rm -rf "${file}"`, (er, so, se) => {
	});
});

Do you see something embarrassingly wrong? Well I forgot to limit the concurrency of the delete commands. I blame caffeine. Thus my Mac tried to spin up 385 child processes all at once. Each one tasked to recursively delete a folder with up to 10,000 files. My Mac's fans started to spin up fast, heated up, and then crashed. It completely shut off. When it rebooted, it no longer drew power from any of the 4 ports. I tried both chargers I had to no avail. Also tried different outlets with no luck. After 1 hour, my remaining battery powered died and my Mac Book Pro became an irreparable brick.

Luckily I have a Linux laptop that has been my work horse. A year ago it also had a charging issue and I was able to fix it myself. For me personally the only reason why I had bought the 2018 Mac Book Pro, was so that I can use the same computer as my students. After hearing this story, I hope more of them will buy a repairable Linux laptop.