-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Build fail issues #122
base: master
Are you sure you want to change the base?
Build fail issues #122
Changes from all commits
836a40a
2824585
582efe9
9ad3b94
92a9881
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -83,8 +83,12 @@ exports.start = function (json, options, buildCallback) { | |
buildStat, | ||
end = function (err) { | ||
var end = new Date(); | ||
log.info('done racing, the gears are toast'); | ||
log.info('finished in ' + timer.calc(start, end) + ', pretty fast huh?'); | ||
if (err) { | ||
log.err('Build failed: Errors encountered during build'); | ||
} else { | ||
log.info('done racing, the gears are toast'); | ||
log.info('finished in ' + timer.calc(start, end)); | ||
} | ||
if (buildCallback) { | ||
buildCallback(err); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. if |
||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,10 +46,16 @@ var runQueue = function() { | |
} | ||
}; | ||
|
||
function standardExitCallback(err) { | ||
if (err) { | ||
process.exit(1); | ||
} | ||
} | ||
|
||
function logAndExit(err) { | ||
if (err) { | ||
log.err(err); | ||
process.exit(1); | ||
standardExitCallback(err); | ||
} | ||
} | ||
|
||
|
@@ -70,7 +76,7 @@ exports.init = function (opts, initCallback) { | |
log.reset(options); | ||
|
||
if (!initCallback) { | ||
initCallback = logAndExit; | ||
initCallback = standardExitCallback; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why not logging all the time? this is confusing. |
||
} | ||
|
||
if (options.cwd) { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -82,7 +82,7 @@ var Stack = require('./stack').Stack, | |
fn = 'error'; | ||
} | ||
if (!!lint && lint.length) { | ||
log.err(file + ' contains ' + lint.length + ' lint errors'); | ||
log.warn(file + ' contains ' + lint.length + ' lint errors'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is this a non-bc change? it seems that lint issues were reported as errors, and now they are just warnings. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes - it makes no sense for them to be marked as errors when they do not kill the build. They only stop the build if ``--fail` is used as an argument. As such, they are just warnings and should be logged as such. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. that's what fyi, |
||
|
||
lint.forEach(function (item) { | ||
counter = counter + 1; | ||
|
@@ -131,7 +131,7 @@ var Stack = require('./stack').Stack, | |
} | ||
|
||
if (messages.length) { | ||
log.err(linted.name + ' contains ' + messages.length + ' lint errors'); | ||
log.warn(linted.name + ' contains ' + messages.length + ' lint errors'); | ||
messages.forEach(function (item) { | ||
if (item && item.reason) { | ||
counter = counter + 1; | ||
|
@@ -363,6 +363,9 @@ var buildJS = function (mod, name, callback) { | |
.write(path.join(mod.buildDir, fileName, fileName + '-min.js')) | ||
.run(function (err, result) { | ||
if (err) { | ||
if (typeof err.error !== 'undefined') { | ||
err = err.error; | ||
} | ||
if (/file has not changed/.test(err)) { | ||
log.warn(name + ': ' + err); | ||
} else if (/ENOENT/.test(err)) { | ||
|
@@ -539,14 +542,13 @@ var buildSkin = function (mod, name, callback) { | |
}) | ||
.cssmin() | ||
.check() | ||
.log('writing skin file with core wrapper') | ||
.log('writing skin file with core wrapper for ' + skinName) | ||
.write(path.join(mod.buildDir, name, 'assets', 'skins', skinName, name + '.css')) | ||
.run(stack.add(function (err) { | ||
if (err) { | ||
log.err(err); | ||
if (err.code === 'ENOENT') { | ||
log.err('skin file is missing: ' + err.path); | ||
return; | ||
if (err.error.code === 'ENOENT') { | ||
log.err('Skin: file is missing: ' + err.error.path); | ||
callback(err.error); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same as above, if callback is prompting the error, why logging the error right before? |
||
} | ||
} | ||
|
||
|
@@ -567,7 +569,11 @@ var buildSkin = function (mod, name, callback) { | |
}) | ||
.log('writing skin file without core wrapper') | ||
.write(path.join(mod.buildDir, name, 'assets', 'skins', skinName, name + '-skin.css')) | ||
.run(stack.add(function () { | ||
.run(stack.add(function (err) { | ||
if (err) { | ||
log.err('Skin: ' + err.error); | ||
return callback(err.error); | ||
} | ||
})); | ||
})); | ||
}); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,12 +3,20 @@ Copyright (c) 2012, Yahoo! Inc. All rights reserved. | |
Code licensed under the BSD License: | ||
http://yuilibrary.com/license/ | ||
*/ | ||
var fs = require('fs'); | ||
|
||
exports.check = function (options, blob, done) { | ||
var bail = null; | ||
var bail = null, | ||
sourceFile; | ||
|
||
if (blob.result.length === 0) { | ||
bail = 'writing zero length file from ' + blob.name; | ||
if (blob.name) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this change doesn't seem related to the problem. if that's the case, let's have it in a different PR |
||
sourceFile = fs.readFileSync(blob.name).toString(); | ||
} | ||
|
||
if (typeof sourceFile === 'undefined' || sourceFile.length !== 0) { | ||
bail = 'writing zero length file from ' + blob.name; | ||
} | ||
} | ||
|
||
done(bail, new blob.constructor(blob.result, blob)); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Some sample content to check for a non-null source |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Some sample content to check for a non-null source |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you're about to hit the brakes, why logging the error? normally the error will be logged in the callback