var sys = require('sys');
var spawn = require('child_process').spawn;
var os = require('os');
var path = require('path');
var fs = require('fs');
var commands = require('../commands/shadow');

exports.cliVersion = '>=3.2.0';
exports.version = '1.0';
exports.title = 'TiShadow Express';
exports.desc  = 'For very basic and quick tishadow usage';
exports.extendedDesc = 'Requires tishadow: `[sudo] npm install -g tishadow`';

exports.init = init;
var logger;
function init(_logger, config, cli) {
  if (process.argv.indexOf('--shadow') !== -1 || process.argv.indexOf('--tishadow') !== -1) {
    cli.addHook('build.pre.compile', preCompileHook(true));
  } else if (process.argv.indexOf('--appify') !== -1) {
    cli.addHook('build.pre.compile', preCompileHook(false));
  }
  logger = _logger;
}
function preCompileHook(isExpress) {
  return function (build, finished) {
    var new_project_dir = path.join(build.projectDir, 'build', 'appify');

    // get ip address 

    var ifaces=os.networkInterfaces();
    var ip_address;
    for (var dev in ifaces) {
      ifaces[dev].forEach(function(details){
        if (details.family=='IPv4' && !details.internal) {
          ip_address = details.address;
        }
      });
    }

    var args = build.cli.argv.$_
         .filter(function(el) { return el !== "--shadow" && el !== "--tishadow" && el !== "--appify"})
         .concat(["--project-dir", new_project_dir]);  
    commands.startAppify(logger, new_project_dir, build.cli.argv.platform, ip_address, function() {
      commands.buildApp(logger,args)
      if (isExpress) {
        commands.startServer(logger);
        commands.startWatch(logger, build.cli.argv.platform, ip_address);
      }
    });
  }
}

@@ -488,16 +488,158 @@
  cli) %7B%0A
+  // users who are on the wrong SDK without this being set... TiShadow would just fail to work at all%0A  cli.config.cli.failOnWrongSDK = true;%0A
   if (pr

Fix an issue where TiShadow just fails to work