-
-
Save savelee/61082f5ae084688bf9c479209346005f to your computer and use it in GitHub Desktop.
Sencha Test Child Process script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var ChildProcess = require('child_process'), | |
spawn = ChildProcess.spawn, | |
shell = process.argv.indexOf('--shell') !== -1, | |
detached = process.argv.indexOf('--detached') !== -1; | |
if (process.argv.length < 3) { | |
console.log('Usage: node app_watch.js /path/to/app [--shell] [--detached]') | |
} else { | |
console.log('shell:', shell, 'detached:', detached); | |
var cmd = spawn('/Users/leeboonstra/bin/Sencha/Cmd/6.2.0.52/sencha', ['-debug', 'app', 'watch'], { | |
//var cmd = spawn('sencha', ['app', 'watch'], { | |
cwd: process.argv[2], | |
shell: '/bin/bash', | |
env: {}, | |
detached: detached | |
}); | |
cmd.stdout.on('data', function(data) { | |
var lines = data.toString().split('\n'); | |
lines.forEach(function(line) { console.log(line) }); | |
}); | |
process.on('SIGINT', function() { | |
process.kill(-cmd.pid); | |
process.exit(0); | |
}); | |
} | |
//run this as node node_app_watch.js from a Sencha application, and note the logs |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment