Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
Scaffold.prototype.init = function init(location) {
// Only provide file bindings for the moment.
this.conf = new nconf.File({ file: location });
this.conf.loadSync();
// This will ensure a saved file always includes an configuration and bundle.
if (!this.conf.get('configuration')) this.conf.set('configuration', {});
if (!this.conf.get('bundle')) this.conf.set('bundle', {});
return this;
};
//
forever.out = new (winston.Logger)({
transports: [
new (winston.transports.Console)()
]
});
//
// ### Export Components / Settings
// Export `version` and important Prototypes from `lib/forever/*`
//
forever.initialized = false;
forever.kill = require('forever-monitor').kill;
forever.checkProcess = require('forever-monitor').checkProcess;
forever.root = process.env.FOREVER_ROOT || path.join(process.env.HOME || process.env.USERPROFILE || '/root', '.forever');
forever.config = new nconf.File({ file: path.join(forever.root, 'config.json') });
forever.Forever = forever.Monitor = require('forever-monitor').Monitor;
forever.Worker = require('./forever/worker').Worker;
forever.cli = require('./forever/cli');
//
// Expose version through `pkginfo`
//
exports.version = require('../package').version;
//
// ### function getSockets (sockPath, callback)
// #### @sockPath {string} Path in which to look for UNIX domain sockets
// #### @callback {function} Continuation to pass control to when complete
// Attempts to read the files from `sockPath` if the directory does not exist,
// then it is created using `mkdirp`.
//
options.loglength = options.loglength || 100;
options.logstream = options.logstream || false;
options.root = options.root || forever.root;
options.pidPath = options.pidPath || path.join(options.root, 'pids');
options.sockPath = options.sockPath || path.join(options.root, 'sock');
//
// If forever is initalized and the config directories are identical
// simply return without creating directories
//
if (forever.initialized && forever.config.get('root') === options.root &&
forever.config.get('pidPath') === options.pidPath) {
return;
}
forever.config = new nconf.File({ file: path.join(options.root, 'config.json') });
//
// Try to load the forever `config.json` from
// the specified location.
//
try {
forever.config.loadSync();
}
catch (ex) { }
//
// Setup the columns for `forever list`.
//
options.columns = options.columns || forever.config.get('columns');
if (!options.columns) {
options.columns = [
options.loglength = options.loglength || 100;
options.logstream = options.logstream || false;
options.root = options.root || forever.root;
options.pidPath = options.pidPath || path.join(options.root, 'pids');
options.sockPath = options.sockPath || path.join(options.root, 'sock');
//
// If forever is initalized and the config directories are identical
// simply return without creating directories
//
if (forever.initialized && forever.config.get('root') === options.root &&
forever.config.get('pidPath') === options.pidPath) {
return;
}
forever.config = new nconf.File({ file: path.join(options.root, 'config.json') });
//
// Try to load the forever `config.json` from
// the specified location.
//
try {
forever.config.loadSync();
}
catch (ex) { }
//
// Setup the columns for `forever list`.
//
options.columns = options.columns || forever.config.get('columns');
if (!options.columns) {
options.columns = [
//
forever.out = new (winston.Logger)({
transports: [
new (winston.transports.Console)()
]
});
//
// ### Export Components / Settings
// Export `version` and important Prototypes from `lib/forever/*`
//
forever.initialized = false;
forever.kill = require('forever-monitor').kill;
forever.checkProcess = require('forever-monitor').checkProcess;
forever.root = path.join(process.env.HOME || process.env.USERPROFILE || '/root', '.forever');
forever.config = new nconf.File({ file: path.join(forever.root, 'config.json') });
forever.Forever = forever.Monitor = require('forever-monitor').Monitor;
forever.Worker = require('./forever/worker').Worker;
forever.cli = require('./forever/cli');
//
// Expose version through `pkginfo`
//
require('pkginfo')(module, 'version');
//
// Expose the global forever service
//
forever.__defineGetter__('service', function () {
return require('./forever/service');
});
options.loglength = options.loglength || 100;
options.logstream = options.logstream || false;
options.root = options.root || forever.root;
options.pidPath = options.pidPath || path.join(options.root, 'pids');
options.sockPath = options.sockPath || path.join(options.root, 'sock');
//
// If forever is initalized and the config directories are identical
// simply return without creating directories
//
if (forever.initialized && forever.config.get('root') === options.root &&
forever.config.get('pidPath') === options.pidPath) {
return;
}
forever.config = new nconf.File({ file: path.join(options.root, 'config.json') });
//
// Try to load the forever `config.json` from
// the specified location.
//
try {
forever.config.loadSync();
}
catch (ex) { }
//
// Setup the columns for `forever list`.
//
options.columns = options.columns || forever.config.get('columns');
if (!options.columns) {
options.columns = [