Rewrite script/build in js.

This commit is contained in:
Cheng Zhao
2013-10-14 14:37:16 +08:00
parent 8edd6ad5d5
commit e17c9ced57
2 changed files with 17 additions and 5 deletions

View File

@@ -27,6 +27,8 @@ var commands = [
'node node_modules/.bin/apm install --silent',
];
process.chdir(path.dirname(__dirname));
var i = 0;
var startCommands = function() {
if (i < commands.length)

View File

@@ -1,8 +1,18 @@
#!/bin/sh
#!/usr/bin/env node
var spawn = require('child_process').spawn;
var path = require('path');
set -e
process.chdir(path.dirname(__dirname));
cd "$(dirname "$0")/.."
var child = spawn(process.execPath, [path.join('script', 'bootstrap')]);
child.stderr.pipe(process.stderr);
child.stdout.pipe(process.stdout);
child.on('exit', function(code) {
if (code != 0) process.exit(code);
./script/bootstrap
./node_modules/.bin/grunt "$@"
var gruntPath = path.join('node_modules', '.bin', 'grunt');
var grunt = spawn(process.execPath, [gruntPath].concat(process.argv.slice(2)));
grunt.stderr.pipe(process.stderr);
grunt.stdout.pipe(process.stdout);
grunt.on('exit', process.exit);
});