clux / badgify

Rebuild readme markdown badges from package.json
MIT License
13 stars 0 forks source link

Incompatible with npm modules without github repo urls in json #3

Closed throrin19 closed 10 years ago

throrin19 commented 10 years ago

Hi, if I try to generate badge of my npm project, i Have this error :

Error: Incompatible with npm modules without github repo urls in json
    at generate (/usr/local/lib/node_modules/badgify/lib/badgify.js:11:11)
    at Object.<anonymous> (/usr/local/lib/node_modules/badgify/lib/badgify.js:54:15)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
    at node.js:906:3

If I see your source code, i see this error is throwed only if repository or repository.url are seted. But, in my package.json, repository.url exists :

{
  "name": "svgutils",
  "version": "0.8.7",
  "description": "Svg Utils for pasing SVGFile and manipulate Matrix object like Snap.svg",
  "main": "index.js",
  "scripts": {
    "test": "mocha --reporter spec -t 5000"
  },
  "repository": {
    "type": "git",
    "url": "https://github.com/throrin19/svgutils.git"
  },
  "keywords": [
    "svg",
    "matrix",
    "parsing",
    "json",
    "xml"
  ],
  "author": "Benjamin Besse <benjamin.besse02@gmail.com>",
  "license": "Apache",
  "readmeFilename": "README.md",
  "gitHead": "5c71469ee5f51b6e08bc8f5e3cd2b0fadf0ed89a",
  "dependencies": {
    "async": "~0.9.0",
    "dxf-parsing": "^0.3.4",
    "gm": "~1.16.0",
    "underscore": "~1.6.0",
    "xml2js": "~0.4.4",
    "xmlbuilder": "~2.4.0"
  },
  "devDependencies": {
    "mocha": ""
  },
  "engines": {
    "node": "~0.10.22"
  }
}
clux commented 10 years ago

Yeah, wrote this pretty quickly, and only indented to use it with github, so you could either update your package.json to use the new npm short repository style:

"repository": {
    "type": "git",
    "url": "throrin19/svgutils"
  },

Or, I'll accept a pull request that changes repoReg (https://github.com/clux/badgify/blob/master/lib/badgify.js#L3) to handle this :)

I'll probably eventually get around to fixing it though, just a bit busy atm.

clux commented 10 years ago

Actually fixed this now. You can update to badgify@0.2.1 and it'll work :]

throrin19 commented 10 years ago

thanks, it works fine now ;)