#!/usr/bin/env node
var exec = require('child_process').exec;
var fs = require('fs');

console.log(__dirname, __filename);

fs.exists(__dirname + '/clients/third-party/LABjs/LAB.js', function(exists) {
  runServer = function() {
    require(__dirname + '/demo-server');
  };

  if (exists) {
    runServer();
    return;
  }
  
  var child = exec('cd ' + __dirname + ' && ls && git submodule update',
    function (error, stdout, stderr) {
      console.log('stdout: ' + stdout);
      console.log('stderr: ' + stderr);
      if (error !== null) {
        console.log('exec error: ' + error);
      }
    }
  );

  child.on('close', runServer); 
});



#!/usr/bin/env node
var exec = require('child_process').exec;
var fs = require('fs');

fs.exists(__dirname + '/clients/third-party/LABjs/LAB.js', function(exists) {
  runServer = function() {
    require(__dirname + '/demo-server');
  };

  if (exists) {
    runServer();
    return;
  }
 
  // JIC we haven't run the npm setup script
  var child = exec('cd ' + __dirname + ' && git submodule update',
    function (error, stdout, stderr) {
      console.log('stdout: ' + stdout);
      console.log('stderr: ' + stderr);
      if (error !== null) {
        console.log('exec error: ' + error);
      }
    }
  );

  child.on('close', runServer);
});



Fix to allow for the fact that we're using git submodules but npm doesn't include the .git folder when downloading.
Fix to allow for the fact that we're using git submodules but npm
doesn't include the .git folder when downloading.
