var cofs = require('co-fs')
	, co = require('co')
	, fs = require('fs')
	, path = require('path')
	, cnsl = require('./cnsl')
	, debug = cnsl.debug
	, strong = cnsl.strong

	, NAME = '.buddy-filelog'
	, RE_ABSOLUTE = /^([a-z]:\\)|^\//i;

exports.filename = path.resolve(NAME);;
exports.files = [];

/**
 * Load existing log file
 */
exports.load = function () {
	var data;

	co(function *() {
		if (yield cofs.exists(exports.filename)) {
			data = yield cofs.readFile(exports.filename, 'utf8');
			try {
				exports.files = JSON.parse(data);
				if (exports.files.length) {
					// Clean if file is old or from another system
					if ((path.sep == '/' && ~data.indexOf('\\'))
						|| (path.sep == '\\' && ~data.indexOf('/'))
						|| RE_ABSOLUTE.test(exports.files[0])) {
							exports.clean();
					}
				}
			} catch (err) {
				exports.clean();
			}
		}
	})();
};

/**
 * Add 'files' to the file log
 * @param {Array} newFiles
 * @returns {Array}
 */
exports.add = function (newFiles) {
	newFiles.forEach(function (file) {
		file = path.relative(process.cwd(), file);
		if (!~exports.files.indexOf(file)) {
			exports.files.push(file);
			debug("adding to filelog: "
				+ (strong(file))
			, 2);
		}
	});
	// Save
	fs.writeFileSync(exports.filename, JSON.stringify(exports.files), 'utf8');
	return exports.files;
};

/**
 * Clean the file log of file references
 */
exports.clean = function () {
	exports.files = [];

	// Save
	fs.writeFileSync(exports.filename, JSON.stringify(exports.files), 'utf8');
	debug('cleaned filelog', 2);
};

@@ -1,56 +1,7 @@
 var
- cofs = require('co-fs')%0A%09, co = require('co')%0A%09,
  fs 
@@ -323,40 +323,12 @@
 ;%0A%0A%09
-co(function *() %7B%0A%09%09if (yield co
+if (
 fs.e
@@ -332,16 +332,20 @@
 s.exists
+Sync
 (exports
@@ -358,17 +358,16 @@
 ame)) %7B%0A
-%09
 %09%09data =
@@ -371,16 +371,8 @@
 a = 
-yield co
 fs.r
@@ -378,16 +378,20 @@
 readFile
+Sync
 (exports
@@ -410,17 +410,16 @@
 utf8');%0A
-%09
 %09%09try %7B%0A
@@ -417,25 +417,24 @@
 %0A%09%09try %7B%0A%09%09%09
-%09
 exports.file
@@ -455,17 +455,16 @@
 (data);%0A
-%09
 %09%09%09if (e
@@ -490,17 +490,16 @@
 ) %7B%0A%09%09%09%09
-%09
 // Clean
@@ -537,17 +537,16 @@
  system%0A
-%09
 %09%09%09%09if (
@@ -591,17 +591,16 @@
 ))%0A%09%09%09%09%09
-%09
 %7C%7C (path
@@ -631,25 +631,24 @@
 dexOf('/'))%0A
-%09
 %09%09%09%09%09%7C%7C RE_A
@@ -687,17 +687,16 @@
 %7B%0A%09%09%09%09%09%09
-%09
 exports.
@@ -704,17 +704,16 @@
 lean();%0A
-%09
 %09%09%09%09%7D%0A%09%09
@@ -713,20 +713,18 @@
 %09%09%09%7D%0A%09%09%09
-%09
 %7D%0A
-%09
 %09%09%7D catc
@@ -736,17 +736,16 @@
 r) %7B%0A%09%09%09
-%09
 exports.
@@ -757,23 +757,14 @@
 ();%0A
-%09
 %09%09%7D%0A%09
-%09%7D%0A%09%7D)();
+%7D
 %0A%7D;%0A

revert async changes