Skip to content

Commit

Permalink
Suggest two other commands if dp.json is missing.
Browse files Browse the repository at this point in the history
  • Loading branch information
AcckiyGerman committed Feb 13, 2018
1 parent 34c35fe commit ee42e16
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion bin/data-push.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,14 @@ Promise.resolve().then(async () => {
console.log('Error: You can push only local datasets.')
process.exit(0)
}
dataset = await Dataset.load(filePath)
try {
dataset = await Dataset.load(filePath)
} catch(err){
console.error('Error: '+err.message)
info("You can run 'data init <path>' to create a datapackage.")
info("You can run 'data help push' to get more info.")
process.exit(1)
}
} else {
dataset = await prepareDatasetFromFile(filePath)
}
Expand Down

0 comments on commit ee42e16

Please sign in to comment.