From fc7c1819e52690d9356bd455e7bce8690abb2938 Mon Sep 17 00:00:00 2001 From: Markus Kohlhase Date: Mon, 7 Oct 2013 21:13:29 +0200 Subject: [PATCH] quick preprocess fix --- bin/cmd.js | 11 +++++++++-- package.json | 3 ++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/bin/cmd.js b/bin/cmd.js index f9bee98..2d6834c 100755 --- a/bin/cmd.js +++ b/bin/cmd.js @@ -1,6 +1,7 @@ #!/usr/bin/env node var http = require('http'); var spawn = require('child_process').spawn; +var execSync = require('exec-sync'); var fs = require('fs'); var qs = require('querystring'); @@ -62,8 +63,14 @@ if ((process.stdin.isTTY || argv._.length) && argv._[0] !== '-') { } var bundleId = Math.floor(Math.pow(16,8)*Math.random()).toString(16); - if (pkg.testling.preprocess) { - // todo + var cmd = pkg.testling.preprocess; + if (typeof cmd === "string") { + try{ + execSync(cmd); + }catch(err){ + console.error("Could not run 'preproccess' command: ", err.message); + return; + } } else if (!pkg.testling.html) { unglob(dir, pkg.testling, function (err, expanded) { diff --git a/package.json b/package.json index 4319ce4..ffc4d89 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,8 @@ "ent": "~0.0.5", "bouncy": "~3.2.0", "shallow-copy": "~0.0.0", - "object-inspect": "~0.1.3" + "object-inspect": "~0.1.3", + "exec-sync": "~0.1.6" }, "bundledDependencies" : [ "browser-launcher" ], "devDependencies": {