Permalink
Browse files

EOL conversion to unix format

  • Loading branch information...
1 parent 6a7c272 commit 3ed88172d09708867514591a7e67537d85b5d028 @indutny indutny committed Nov 30, 2010
Showing with 68 additions and 65 deletions.
  1. +6 −3 package.json
  2. +62 −62 uninstall.js
View
@@ -10,6 +10,9 @@
"type" : "git",
"url" : "http://github.com/donnerjack13589/node.uninstall.git"
},
- "engines": { "node": ">= 0.0.0" }, "scripts": {
- "preinstall": "read -p '\r\nThis will uninstall all your npm packages, are you sure? Type y to continue\r\n' SURE; if [ \"x$SURE\" != \"xy\" ]; then exit 1; fi", "install": "node uninstall.js" }
-}
+ "engines": { "node": ">= 0.0.0" },
+ "scripts": {
+ "preinstall": "read -p '\r\nThis will uninstall all your npm packages, are you sure? Type y to continue\r\n' SURE; if [ \"x$SURE\" != \"xy\" ]; then exit 1; fi",
+ "install": "node uninstall.js"
+ }
+}
View
@@ -1,62 +1,62 @@
-var exec = require('child_process').exec,
- util = require('util'),
- npm = require('npm'),
- queue = [];
-
-
-util.log('Installing module!');
-
-npm.load({outfd: 0}, function(err) {
- if (err) {
- util.log('Failed to load npm');
- return;
- }
-
- npm.commands.list(['installed'], function(err, modules) {
- if (err) {
- util.puts('Some error!');
- util.puts(stderr);
- return;
- }
- for (var name in modules) {
- var module = modules[name];
-
- // Skip npm itself
- if (name == 'npm' || name == 'uninstall') continue;
-
- for (var version in module.versions) {
- if (module.versions[version].installed) {
- queue.push(name);
- break;
- }
- }
- }
-
- processQueue();
- });
-
- function processQueue() {
- var i = 0;
- function next() {
- if (i >= queue.length) {
- util.puts('Work is done!');
- util.puts('So long, and thanks for all the fish!');
-
- return;
- }
- var module = queue[i++];
-
- npm.commands.uninstall(module, function(err) {
- if (err) {
- util.puts('Failed processing: ' + module);
- // queue.push(module);
- return next();
- }
- util.puts('Processed: ' + module);
- next();
- });
- }
-
- next();
- }
-});
+var exec = require('child_process').exec,
+ util = require('util'),
+ npm = require('npm'),
+ queue = [];
+
+
+util.log('Installing module!');
+
+npm.load({outfd: 0}, function(err) {
+ if (err) {
+ util.log('Failed to load npm');
+ return;
+ }
+
+ npm.commands.list(['installed'], function(err, modules) {
+ if (err) {
+ util.puts('Some error!');
+ util.puts(stderr);
+ return;
+ }
+ for (var name in modules) {
+ var module = modules[name];
+
+ // Skip npm itself
+ if (name == 'npm' || name == 'uninstall') continue;
+
+ for (var version in module.versions) {
+ if (module.versions[version].installed) {
+ queue.push(name);
+ break;
+ }
+ }
+ }
+
+ processQueue();
+ });
+
+ function processQueue() {
+ var i = 0;
+ function next() {
+ if (i >= queue.length) {
+ util.puts('Work is done!');
+ util.puts('So long, and thanks for all the fish!');
+
+ return;
+ }
+ var module = queue[i++];
+
+ npm.commands.uninstall(module, function(err) {
+ if (err) {
+ util.puts('Failed processing: ' + module);
+ // queue.push(module);
+ return next();
+ }
+ util.puts('Processed: ' + module);
+ next();
+ });
+ }
+
+ next();
+ }
+});

0 comments on commit 3ed8817

Please sign in to comment.