diff --git a/CHANGELOG.md b/CHANGELOG.md index 45e397a..b380042 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +### 0.8.2 (January 30, 2015) + +* Fix an issue where the CLI doesn't work on windows. + ### 0.8.1 (May 30, 2014) * Update SUIT CSS URL. @@ -78,4 +82,4 @@ ### 0.1.1 (June 10, 2013) -* First public release. \ No newline at end of file +* First public release. diff --git a/bin/html-inspector-jsdom b/bin/html-inspector-jsdom new file mode 100755 index 0000000..478f6a7 --- /dev/null +++ b/bin/html-inspector-jsdom @@ -0,0 +1,43 @@ +#!/usr/bin/env node + +var fs = require('fs'); +var jsdom = require('jsdom'); +var program = require('commander'); + +program + .version(require('../package.json').version) + .usage('[options] ') + .option('-c, --config [file]', + 'Configuration file (./html-inspector-config.js)', + './html-inspector-config.js') + .parse(process.argv); + +if (program.args.length === 0) { + program.help(); + process.exit(); +} + +// Try to resolve local file, otherwise assume and pass url +// var inputLocation = program.args[0]; +// inspectLocation = fs.existsSync(path.resolve(inputLocation)) ? path.resolve(inputLocation) : inputLocation; + + +// if (program.config) { +// configFile = fs.existsSync(path.resolve(program.config)) +// ? path.resolve(program.config) : ""; +// } + +jsdom.env( + program.args[0], + ['html-inspector.js'], + function(errors, window) { + + window.HTMLInspector.inspect({ + onComplete: function(errors) { + errors.forEach(function(error) { + console.log(error.message); + }); + } + }); + } +) diff --git a/bower.json b/bower.json index ce23d84..235cf5b 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "html-inspector", - "version": "0.8.1", + "version": "0.8.2", "main": "html-inspector.js", "ignore": [ "bin", diff --git a/html-inspector.js b/html-inspector.js index 55ab3d4..1651c11 100644 --- a/html-inspector.js +++ b/html-inspector.js @@ -1,10 +1,10 @@ /*! - * HTML Inspector - v0.8.1 + * HTML Inspector - v0.8.2 * - * Copyright (c) 2014 Philip Walton + * Copyright (c) 2015 Philip Walton * Released under the MIT license * - * Date: 2014-05-30 + * Date: 2015-01-30 */ (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o