There were several CI failures today where it seemed like the
atom-shell version in the temp directory wasn't complete, it was
missing many files causing the build to fail when the specs were
run.
What made this worse was that running script/clean on these machines
didn't clean out these bad versions since the temp directory was different
when run via Jenkins vs. ssh'ing into the machines so the folders were
left there and the builds kept failing.
Atom already stores the compile cache to ~/.atom as well as the node cache
so putting atom-shell there as well keeps things consistent.
Now `script/clean` uses `del /F /Q /S` to cleanup the folders but `del /S` deletes specified files from all subdirectories, so if we pass a folder as a parameter it will only delete the files within the folder and all subfolders recursively but not the actual folders. And this can cause problems, see Issue #2487
A better way is to use `rmdir /S /Q` as it takes care of the folder itself and it's contents.
/S - removes all directories and files in the specified directory in addition to the directory itself. (removes the directory tree)
/Q - obvious this is quite mode
I tested this approach on a couple machines that needed a clean before building and works OK with `rmdir`. It might give a warning in the console like `The system cannot find the file specified.` because not all of them are there but it can be ignored as the script will finish running.
/tmp isn't always available, is on precious RAM-backed fs or simply not
what the user has set his $TMPDIR to. According to the specification, we
should use $TMPDIR, which node lets us find through os.tmpdir().
Also, contributing.md isn't in favour of using platform-dependent code.
This commit focusses only on Linux, and leaves OS X as is with /tmp for
discussion.