{"action":"created","issue":{"url":"https://api.github.com/repos/ember-cli/ember-cli/issues/4462","labels_url":"https://api.github.com/repos/ember-cli/ember-cli/issues/4462/labels{/name}","comments_url":"https://api.github.com/repos/ember-cli/ember-cli/issues/4462/comments","events_url":"https://api.github.com/repos/ember-cli/ember-cli/issues/4462/events","html_url":"https://github.com/ember-cli/ember-cli/pull/4462","id":95547502,"number":4462,"title":"Make ember destroy and ember generate give a better error when called…","user":{"login":"marcioj","id":821095,"avatar_url":"https://avatars.githubusercontent.com/u/821095?v=3","gravatar_id":"","url":"https://api.github.com/users/marcioj","html_url":"https://github.com/marcioj","followers_url":"https://api.github.com/users/marcioj/followers","following_url":"https://api.github.com/users/marcioj/following{/other_user}","gists_url":"https://api.github.com/users/marcioj/gists{/gist_id}","starred_url":"https://api.github.com/users/marcioj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marcioj/subscriptions","organizations_url":"https://api.github.com/users/marcioj/orgs","repos_url":"https://api.github.com/users/marcioj/repos","events_url":"https://api.github.com/users/marcioj/events{/privacy}","received_events_url":"https://api.github.com/users/marcioj/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-07-16T22:48:49Z","updated_at":"2015-07-17T01:10:35Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/ember-cli/ember-cli/pulls/4462","html_url":"https://github.com/ember-cli/ember-cli/pull/4462","diff_url":"https://github.com/ember-cli/ember-cli/pull/4462.diff","patch_url":"https://github.com/ember-cli/ember-cli/pull/4462.patch"},"body":"… without arguments\r\n\r\nWhen calling `ember generate` or `ember destroy` without arguments an ugly error is threw\r\n\r\n```\r\nArguments to path.resolve must be strings\r\nTypeError: Arguments to path.resolve must be strings\r\n    at Object.posix.resolve (path.js:439:13)\r\n    at Function.Blueprint.lookup (/home/marcio/workspace/javascript/ember-cli/lib/models/blueprint.js:1220:26)\r\n    at Class.module.exports.Command.extend.lookupBlueprint (/home/marcio/workspace/javascript/ember-cli/lib/commands/destroy.js:79:22)\r\n    at Class.module.exports.Command.extend.beforeRun (/home/marcio/workspace/javascript/ember-cli/lib/commands/destroy.js:31:33)\r\n    at CLI.<anonymous> (/home/marcio/workspace/javascript/ember-cli/lib/cli/cli.js:77:13)\r\n    at lib$rsvp$$internal$$tryCatch (/home/marcio/workspace/javascript/ember-cli/node_modules/rsvp/dist/rsvp.js:489:16)\r\n    at lib$rsvp$$internal$$invokeCallback (/home/marcio/workspace/javascript/ember-cli/node_modules/rsvp/dist/rsvp.js:501:17)\r\n    at lib$rsvp$$internal$$publish (/home/marcio/workspace/javascript/ember-cli/node_modules/rsvp/dist/rsvp.js:472:11)\r\n    at lib$rsvp$asap$$flush (/home/marcio/workspace/javascript/ember-cli/node_modules/rsvp/dist/rsvp.js:1290:9)\r\n    at process._tickCallback (node.js:355:11)\r\n```\r\n\r\nThis PR updates the `beforeRun` method of both the commands to do nothing in the case of the arguments were empty, since `this.lookupBlueprint` expect a non empty name to be provided. In this way the `run` method has the opportunity to give the proper error message, like ``` The `ember destroy` command requires a blueprint name to be specified. For more details, use `ember help`. ``` "},"comment":{"url":"https://api.github.com/repos/ember-cli/ember-cli/issues/comments/122141796","html_url":"https://github.com/ember-cli/ember-cli/pull/4462#issuecomment-122141796","issue_url":"https://api.github.com/repos/ember-cli/ember-cli/issues/4462","id":122141796,"user":{"login":"stefanpenner","id":1377,"avatar_url":"https://avatars.githubusercontent.com/u/1377?v=3","gravatar_id":"","url":"https://api.github.com/users/stefanpenner","html_url":"https://github.com/stefanpenner","followers_url":"https://api.github.com/users/stefanpenner/followers","following_url":"https://api.github.com/users/stefanpenner/following{/other_user}","gists_url":"https://api.github.com/users/stefanpenner/gists{/gist_id}","starred_url":"https://api.github.com/users/stefanpenner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stefanpenner/subscriptions","organizations_url":"https://api.github.com/users/stefanpenner/orgs","repos_url":"https://api.github.com/users/stefanpenner/repos","events_url":"https://api.github.com/users/stefanpenner/events{/privacy}","received_events_url":"https://api.github.com/users/stefanpenner/received_events","type":"User","site_admin":false},"created_at":"2015-07-17T01:10:35Z","updated_at":"2015-07-17T01:10:35Z","body":"@marcioj tests do not appear to like this PR"}}