pulsar/script/clean
Kyle Robinson Young 8239bb7e05 Add clean script
2013-12-16 17:51:20 -08:00

26 lines
878 B
JavaScript
Executable File

#!/usr/bin/env node
var cp = require('./utils/child-process-wrapper.js');
var path = require('path');
var os = require('os');
var rimraf = require('rimraf');
var productName = require('../package.json').productName;
process.chdir(path.dirname(__dirname));
var home = process.env[(process.platform === 'win32') ? 'USERPROFILE' : 'HOME'];
var tmpdir = os.tmpdir();
var command = process.platform === 'win32' ? 'taskkill /IM ' + productName + '.exe' : 'pkill -9 ' + productName;
cp.safeExec(command, function() {
[
[__dirname, '..', 'node_modules'],
[__dirname, '..', 'atom-shell'],
[home, '.atom', '.node-type'],
[home, '.atom', 'storage'],
[tmpdir, 'atom-build'],
[tmpdir, 'atom-cached-atom-shells'],
[tmpdir, 'atom-compile-cache'],
].forEach(function(filepath) {
rimraf(path.resolve.apply(path.resolve, filepath), function() {});
});
});