Skip to content
Browse files

removed some garbage in .package

  • Loading branch information...
1 parent e169c9e commit 4968886663ed2522899608dd197ed197cb8f202f @fb55 fb55 committed Sep 8, 2012
Showing with 10 additions and 18 deletions.
  1. +10 −18 lib/require-analyzer.js
View
28 lib/require-analyzer.js
@@ -335,30 +335,23 @@ analyzer.package = function (options, callback) {
var newoptions = analyzer.clone(options);
function setMain(files, pkg, newoptions, callback) {
- var file = null;
-
function nextFile() {
- file = files.shift();
- if (typeof file === 'undefined') {
+ if (!files.length) {
return callback(pkg, newoptions);
}
- checkFile(file);
- }
- function checkFile(file) {
- exists(file, fileExists);
- }
-
- function fileExists(exists) {
- if (exists) {
- pkg.main = file;
- return callback(pkg, newoptions);
- }
- nextFile();
+ var file = files.shift();
+
+ exists(file, function(exists){
+ if (exists) {
+ pkg.main = file;
+ callback(pkg, newoptions);
+ }
+ else nextFile();
+ });
}
nextFile();
- return;
}
function setTarget(pkg, newoptions) {
@@ -367,7 +360,6 @@ analyzer.package = function (options, callback) {
if (newTarget === false) {
todo = 1;
- deps = null;
dequeue(new Error('Couldn\'t resolve path ' + newPath));
}
return processOptions(newoptions);

0 comments on commit 4968886

Please sign in to comment.
Something went wrong with that request. Please try again.