dat-ecosystem-archive / gasket

Build cross platform data pipelines [ DEPRECATED - More info on active projects and modules at https://dat-ecosystem.org/ ]
191 stars 19 forks source link

Invalid package.json causes data-plumber to emit misleading message about json path #1

Closed johnnyman727 closed 10 years ago

johnnyman727 commented 10 years ago

I'm using @maxogden's data-plumber lesson to learn about Gasket.

Running data-plumber run package.json with an invalid package.json will cause data-plumber to search in the wrong directory for the package.json.

Test package.json (notice the extra comma in the gasket section):

{
  "name": "dataplumber",
  "version": "0.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "gasket": [
    "jsonfilter 'rows.*.doc.song'",
  ],
  "author": "",
  "license": "ISC",
  "dependencies": {
    "transform-uppercase": "^1.0.0",
    "jsonfilter": "^1.0.1",
    "csv-parser": "^1.4.1",
    "trim-object-stream": "^1.0.0"
  }
}

When I run this in data-plumber, it gives the following output:

➜  dataplumber  data-plumber run package.json   
cat /usr/local/lib/node_modules/data-plumber/data/nextbus.xml | gasket run --config /Users/Jon/Code/dataplumber/package.json
ENOTDIR, open '/Users/Jon/Code/dataplumber/package.json/package.json'

The error shows that the path has an extra /package.json added to the end.