mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-11-10 10:17:11 +03:00
2fe647c950
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.
47 lines
1.4 KiB
JavaScript
Executable File
47 lines
1.4 KiB
JavaScript
Executable File
#!/usr/bin/env node
|
|
var cp = require('./utils/child-process-wrapper.js');
|
|
var fs = require('fs');
|
|
var path = require('path');
|
|
var os = require('os');
|
|
|
|
var removeCommand = process.platform === 'win32' ? 'rmdir /S /Q ' : 'rm -rf ';
|
|
var productName = require('../package.json').productName;
|
|
|
|
process.chdir(path.dirname(__dirname));
|
|
var home = process.env[(process.platform === 'win32') ? 'USERPROFILE' : 'HOME'];
|
|
var tmpdir = os.tmpdir();
|
|
|
|
// Windows: Use START as a way to ignore error if Atom.exe isnt running
|
|
var killatom = process.platform === 'win32' ? 'START taskkill /F /IM ' + productName + '.exe' : 'pkill -9 ' + productName + ' || true';
|
|
|
|
var commands = [
|
|
killatom,
|
|
[__dirname, '..', 'node_modules'],
|
|
[__dirname, '..', 'build', 'node_modules'],
|
|
[__dirname, '..', 'apm', 'node_modules'],
|
|
[__dirname, '..', 'atom-shell'],
|
|
[home, '.atom', '.node-gyp'],
|
|
[home, '.atom', 'storage'],
|
|
[home, '.atom', '.npm'],
|
|
[home, '.atom', 'compile-cache'],
|
|
[home, '.atom', 'atom-shell'],
|
|
[tmpdir, 'atom-build'],
|
|
[tmpdir, 'atom-cached-atom-shells'],
|
|
];
|
|
var run = function() {
|
|
var next = commands.shift();
|
|
if (!next)
|
|
process.exit(0);
|
|
|
|
if (Array.isArray(next)) {
|
|
var pathToRemove = path.resolve.apply(path.resolve, next);
|
|
if (fs.existsSync(pathToRemove))
|
|
next = removeCommand + pathToRemove;
|
|
else
|
|
return run();
|
|
}
|
|
|
|
cp.safeExec(next, run);
|
|
};
|
|
run();
|