Strider-CD / strider

Open Source Continuous Integration & Deployment Server
http://strider-cd.github.io/
4.59k stars 432 forks source link

Can't start Strider with pm2 #449

Open robianmcd opened 10 years ago

robianmcd commented 10 years ago

I'm trying to start strider with pm2 but when I do, module.parent is set to an object so strider doesn't actually start. Any idea why this is? What does checking for module.parent actually do? Is that so you can require it in another script?

Thanks

niallo commented 10 years ago

Not sure how pm2 works. module.parent is supposed to check whether Strider is being require()'d as a module or not.

On Fri, Jun 27, 2014 at 12:55 PM, Rob notifications@github.com wrote:

I'm trying to start strider with pm2 but when I do, module.parent is set to an object so strider doesn't actually start. Any idea why this is? What does checking for module.parent actually do? Is that so you can require it in another script?

Thanks

— Reply to this email directly or view it on GitHub https://github.com/Strider-CD/strider/issues/449.

Niall O'Higgins W: http://niallohiggins.com E: n@niallo.me T: @niallohiggins

robianmcd commented 10 years ago

ok thanks. I'll ask over at pm2 and try and find out why module.parent isn't undefined

soyuka commented 10 years ago

https://github.com/Unitech/pm2/issues/539 you could link the issue for others (:

Just went through the code and noticed: https://github.com/Strider-CD/strider/blob/master/bin/strider#L224 fs is never defined ;)

robianmcd commented 10 years ago

@niallo what do you think about only checking for module.parent if no commands are passed in and allowing users to explicitly pass in a 'start' command? e.g.:

parser.command('start')
  .option('extension_path', {
      abbr: 'm'
    , help: "Specify path to extensions (defaults to node_modules)"
  })
  .callback(function(opts){
    start(opts.extension_path);
  });

parser.nocommand()
  .option('extension_path', {
      abbr: 'm'
    , help: "Specify path to extensions (defaults to node_modules)"
  })
  .callback(function(opts){
    if (!module.parent) {
        start(opts.extension_path);
    }
  });

parser.parse();
knownasilya commented 10 years ago

@soyuka thanks, fixed in #500

knownasilya commented 10 years ago

@niallo which option do you think we should go with? The on suggested at Unitech/pm2#539 or the one mentioned by @robianmcd?