Files
bower/lib/util/read-json.js
Andre Cruz fd31f247a6 Unit of work implementation.
A unit of work is a simple storage with write lock/unlock.
The manager/package now share a unit of work instance.
The unit of work is used to prevent shared dependencies from being cloned/copied "at the same time" fixing issue #81.
The prune and version resolving algorithm was also not correct. It now resolves versions correctly, fixing issue #57.

- Fix I/O errors caused by copying/clone repos simultaneously to the same dest.
- Optimize the clone/copy step by avoiding it if the last resolved resource is the same.
- Fix failing test (at least on my windows machine)
- Add some more tests
- Fix CS.
2012-10-11 13:40:54 +01:00

24 lines
742 B
JavaScript

// ==========================================
// BOWER: read-json.js - with logging fun
// ==========================================
// Copyright 2012 Twitter, Inc
// Licensed under The MIT License
// http://opensource.org/licenses/MIT
// ==========================================
var readJSON = require('read-package-json');
var template = require('./template');
var read = module.exports = function (path, cb, obj) {
readJSON.log = {
info: function () {},
verbose: function () {},
warn: function (what, name, shizzle) {
if (read.showWarnings) {
template('warn', { name: name.replace(/@/, '#'), shizzle: shizzle })
.on('data', obj.emit.bind(obj, 'data'));
}
}
};
readJSON(path, cb);
};