Permalink
Browse files

* npm publishing bugs

  • Loading branch information...
1 parent 5e9f855 commit 296f2d61486b05c8d4a018fcab3ba5d641bdc8af Julien Polo committed Nov 29, 2010
Showing with 99 additions and 99 deletions.
  1. +98 −98 bin/node-lint
  2. +1 −1 package.json
View
@@ -15,115 +15,115 @@ var Launcher = lint.Launcher;
-if (__filename === process.ARGV[1]) {
- var usage, args, positionals, launcher, options, configFile;
-
- //called as main executable
-
- usage = "Usage: " + process.ARGV[0] + " file.js [dir1 file2 dir2 ...] [options]\n" +
- "Options:\n\n" +
- " --config=FILE the path to a JSON file with JSLINT options\n" +
- " --formatter=FILE optional path to a /dir/dir/file.hs file to customize the output\n" +
- " -h, --help display this help and exit\n" +
- " -v, --version output version information and exit";
-
- args = process.ARGV.splice(2);
- positionals = [];
- options = {
- formatter: {
- },
- parser: {
- }
- };
- configFile = process.env.NODELINT_CONFIG_FILE;
-
- launcher = new Launcher();
- while (args.length !== 0) {
- arg = args.shift();
- switch (arg) {
- case '-v':
- case '--version':
- var content, pkg;
- content = fs.readFileSync(path.join(__filename, '..', '..', '..', 'package.json'), 'utf8');
- pkg = JSON.parse(content);
- util.puts(pkg.version);
- process.exit(0);
- break;
- case '-h':
- case '--help':
- util.puts(usage);
- process.exit(0);
- break;
- case '--silent':
- options.silent = true;
- break;
- case '--pretty':
- options.formatter.pretty = true;
- break;
- case '--no-color':
- case '--no-colors':
- options.formatter.colors = false;
- break;
- default:
- if (arg.indexOf('--formatter') >= 0) {
- options.formatter.type = 'callback';
- options.formatter.callback = fs.readFileSync(arg.split('=')[1], 'utf8');
- } else if (arg.indexOf('--format') >= 0) {
- options.formatter.type = arg.split('=')[1];
- } else if (arg.indexOf('--mode') >= 0) {
- options.formatter.mode = arg.split('=')[1];
- } else if (arg.indexOf('--config') >= 0) {
- var file, source;
-
- configFile = arg.split('=')[1];
-
- } else {
- positionals.push(arg);
- }
+
+var usage, args, positionals, launcher, options, configFile;
+
+//called as main executable
+
+usage = "Usage: " + process.ARGV[0] + " file.js [dir1 file2 dir2 ...] [options]\n" +
+"Options:\n\n" +
+" --config=FILE the path to a JSON file with JSLINT options\n" +
+" --formatter=FILE optional path to a /dir/dir/file.hs file to customize the output\n" +
+" -h, --help display this help and exit\n" +
+" -v, --version output version information and exit";
+
+args = process.ARGV.splice(2);
+positionals = [];
+options = {
+ formatter: {
+ },
+ parser: {
+ }
+};
+configFile = process.env.NODELINT_CONFIG_FILE;
+
+launcher = new Launcher();
+while (args.length !== 0) {
+ arg = args.shift();
+ switch (arg) {
+ case '-v':
+ case '--version':
+ var content, pkg;
+ content = fs.readFileSync(path.join(__filename, '..', '..', '..', 'package.json'), 'utf8');
+ pkg = JSON.parse(content);
+ util.puts(pkg.version);
+ process.exit(0);
+ break;
+ case '-h':
+ case '--help':
+ util.puts(usage);
+ process.exit(0);
+ break;
+ case '--silent':
+ options.silent = true;
+ break;
+ case '--pretty':
+ options.formatter.pretty = true;
+ break;
+ case '--no-color':
+ case '--no-colors':
+ options.formatter.colors = false;
+ break;
+ default:
+ if (arg.indexOf('--formatter') >= 0) {
+ options.formatter.type = 'callback';
+ options.formatter.callback = fs.readFileSync(arg.split('=')[1], 'utf8');
+ } else if (arg.indexOf('--format') >= 0) {
+ options.formatter.type = arg.split('=')[1];
+ } else if (arg.indexOf('--mode') >= 0) {
+ options.formatter.mode = arg.split('=')[1];
+ } else if (arg.indexOf('--config') >= 0) {
+ var file, source;
+
+ configFile = arg.split('=')[1];
+
+ } else {
+ positionals.push(arg);
}
}
+}
+
+//Load default config file from environment
+if (configFile) {
+ var source;
- //Load default config file from environment
- if (configFile) {
- var source;
-
- //read config file
- try {
- source = fs.readFileSync(configFile, 'utf8');
- } catch (e) {
- launcher.printError('Read error when accessing "' + configFile + '".');
- }
-
- //Remove comments
- source = source.replace(/\/\*.+?\*\/|\/\/.*(?=[\n\r])/g, '');
-
- //Parse config
- try {
- source = JSON.parse(source);
- } catch (e) {
- console.log(e.toString());
- launcher.printError('Parse Error in "' + configFile + '"');
- }
-
-
- try {
- launcher.configure(source);
- } catch (e) {
- console.log(e.toString());
- launcher.printError('Parse Error in "' + configFile + '"');
- }
+ //read config file
+ try {
+ source = fs.readFileSync(configFile, 'utf8');
@fd
fd Dec 8, 2010

fs is missing...

@jpolo
jpolo Dec 8, 2010 Owner

Corrected & published on npm. Thanks

+ } catch (e) {
+ launcher.printError('Read error when accessing "' + configFile + '".');
}
+ //Remove comments
+ source = source.replace(/\/\*.+?\*\/|\/\/.*(?=[\n\r])/g, '');
+
+ //Parse config
try {
- launcher.configure(options);
+ source = JSON.parse(source);
} catch (e) {
- launcher.printError('Configuration : ' + e.toString());
+ console.log(e.toString());
+ launcher.printError('Parse Error in "' + configFile + '"');
}
+
try {
- launcher.run(positionals);
+ launcher.configure(source);
} catch (e) {
- launcher.printError('Execution : ' + e.toString());
+ console.log(e.toString());
+ launcher.printError('Parse Error in "' + configFile + '"');
}
}
+try {
+ launcher.configure(options);
+} catch (e) {
+ launcher.printError('Configuration : ' + e.toString());
+}
+
+try {
+ launcher.run(positionals);
+} catch (e) {
+ launcher.printError('Execution : ' + e.toString());
+}
+
+
View
@@ -1,7 +1,7 @@
{
"name": "lint",
"description": "This package provide lint validation library + node-lint command line tool allows you to check for problems using JSLint. You can specify your own --config file to use alternate JSLint options and your own --formatter file if you want to customize the generated output.",
- "version": "0.1.1",
+ "version": "0.1.2",
"homepage": "https://github.com/as-jpolo/node-lint",
"author": "tav <tav@espians.com> (http://tav.espians.com)",
"contributors": [

0 comments on commit 296f2d6

Please sign in to comment.