Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Better: only do the wscript if it actually has a configure and build …

…step, but fail if it fails.
  • Loading branch information...
commit 6cdf2fa6a46b37dbbdda6e9959f7e37f2e783933 1 parent 8107dd1
@isaacs isaacs authored
Showing with 5 additions and 3 deletions.
  1. +5 −3 lib/utils/read-json.js
View
8 lib/utils/read-json.js
@@ -8,8 +8,10 @@ var fs = require("fs")
function readJson (jsonFile, opts, cb) {
if (typeof cb !== "function") cb = opts, opts = {}
- fs.stat(path.join(path.dirname(jsonFile), "wscript"), function (er) {
- opts.wscript = !er
+ fs.readFile(path.join(path.dirname(jsonFile), "wscript"), function (er, data) {
+ if (er) opts.wscript = false
+ else opts.wscript = data.toString().match(/(^|\n)def build\b/)
+ && data.toString().match(/(^|\n)def configure\b/)
fs.readFile(jsonFile, processJson(opts, cb))
})
}
@@ -86,7 +88,7 @@ function processObject (opts, cb) { return function (er, json) {
var scripts = json.scripts = json.scripts || {}
if (!scripts.install && !scripts.preinstall) {
// don't fail if it was unexpected, just try.
- scripts.preinstall = "node-waf configure build || true"
+ scripts.preinstall = "node-waf configure build"
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.