Created
December 3, 2013 06:01
-
-
Save divanvisagie/7764578 to your computer and use it in GitHub Desktop.
Node build scripts for brackets, to be placed in home directory. Requires brackets builder , theseus for brackets and node-theseus
This file contains hidden or 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
| [ | |
| { | |
| "name": "Python", | |
| "cmd": "python $FILE" | |
| }, | |
| { | |
| "name": "JavaScript", | |
| "cmd": "sh nodebuild.sh $FILE" | |
| }, | |
| { | |
| "name": "Ruby", | |
| "cmd": "ruby $FILE" | |
| } | |
| ] |
This file contains hidden or 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 fs = require('fs'), | |
| spawn = require('child_process').spawn, | |
| util = require('util'); | |
| function killProc( pid ) { | |
| var proc = spawn('kill',[pid]); | |
| proc.stdout.pipe( process.stdout ); | |
| proc.stderr.pipe( process.stderr ); | |
| proc.on('close',function(code){ | |
| console.log('exited with code %d',code); | |
| }) | |
| } | |
| process.stdin.on('data',function(data){ | |
| var lst = data.toString().split('\n'); | |
| lst = lst.map(function(itm){ | |
| return itm.split('??')[0].trim(); | |
| }); | |
| lst = lst.filter(function(data){ | |
| if(data !== '') return data; | |
| }); | |
| for (var i=0; i <lst.length; i++){ | |
| killProc( lst[i] ); | |
| } | |
| console.log(lst); | |
| }); |
This file contains hidden or 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
| #!/bin/bash | |
| export PATH=$PATH:/usr/local/bin | |
| args=("$@") | |
| ps -e | grep node | grep ${args[0]} | grep theseus | node nodebuild.js | |
| node-theseus ${args[0]} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment