Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Reboot example with forever
crontab.load(function(err, tab) {
require('npm').load(function (err, npm) {
if (err) { console.log(err); process.exit(1); }
var path = require('path');
var util = require('util');
var uuid = '322ed3d0-6869-11e1-b86c-0800200c9a66';
var npmPrefix = npm.config.get('prefix');
var npmBinRoot = path.join(npmPrefix, 'bin');
var nodePath = process.execPath.split('/').slice(0, -1).join('/');
var exportCommand = 'export PATH=' + nodePath + ':$PATH';
var foreverCommand = path.join(npmBinRoot, 'forever');
var thisCommand = __filename;
var sysCommand = util.format('%s && %s start %s', exportCommand, foreverCommand, thisCommand);
tab.remove(tab.findComment(uuid));
if (install == true) {
tab.create(sysCommand, uuid).everyReboot();
}
tab.save();
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.