{"action":"created","issue":{"url":"https://api.github.com/repos/kevinrenskers/raml2html/issues/128","labels_url":"https://api.github.com/repos/kevinrenskers/raml2html/issues/128/labels{/name}","comments_url":"https://api.github.com/repos/kevinrenskers/raml2html/issues/128/comments","events_url":"https://api.github.com/repos/kevinrenskers/raml2html/issues/128/events","html_url":"https://github.com/kevinrenskers/raml2html/issues/128","id":60821081,"number":128,"title":"--output does not create missing directories","user":{"login":"commonquail","id":603326,"avatar_url":"https://avatars.githubusercontent.com/u/603326?v=3","gravatar_id":"","url":"https://api.github.com/users/commonquail","html_url":"https://github.com/commonquail","followers_url":"https://api.github.com/users/commonquail/followers","following_url":"https://api.github.com/users/commonquail/following{/other_user}","gists_url":"https://api.github.com/users/commonquail/gists{/gist_id}","starred_url":"https://api.github.com/users/commonquail/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/commonquail/subscriptions","organizations_url":"https://api.github.com/users/commonquail/orgs","repos_url":"https://api.github.com/users/commonquail/repos","events_url":"https://api.github.com/users/commonquail/events{/privacy}","received_events_url":"https://api.github.com/users/commonquail/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-03-12T13:49:00Z","updated_at":"2015-03-27T02:20:44Z","closed_at":null,"body":"If the path given to `-o` includes a missing directory, [`fs.writeFileSync()`](https://nodejs.org/api/fs.html#fs_fs_writefilesync_filename_data_options) throws an unhandled (and undocumented...) error and `raml2html` exits successfully without producing any output.\r\n\r\n```bash\r\n$ ls\r\ndummy.raml\r\n$ raml2html --version\r\n1.5.0\r\n$ raml2html --input dummy.raml --output build/dummy.html\r\n$ echo $?\r\n0\r\n$ ls\r\ndummy.raml\r\n```\r\nIf we make a quick change to see what's going on:\r\n```javascript\r\ntry {\r\n    fs.writeFileSync(program.output, result);\r\n} catch (err) { console.log(err); }\r\n```\r\n```bash\r\n$ raml2html --input dummy.raml --output build/dummy.html\r\n{ [Error: ENOENT, no such file or directory 'build/dummy.html']\r\n  errno: 34,\r\n  code: 'ENOENT',\r\n  path: 'build/dummy.html',\r\n  syscall: 'open' }\r\n```\r\n\r\n[There are a few ways around this](http://stackoverflow.com/a/16317628/482758) but is it `raml2html`'s responsibility to ensure the path is valid? Arguments can be made both ways."},"comment":{"url":"https://api.github.com/repos/kevinrenskers/raml2html/issues/comments/86789694","html_url":"https://github.com/kevinrenskers/raml2html/issues/128#issuecomment-86789694","issue_url":"https://api.github.com/repos/kevinrenskers/raml2html/issues/128","id":86789694,"user":{"login":"justjacksonn","id":10764578,"avatar_url":"https://avatars.githubusercontent.com/u/10764578?v=3","gravatar_id":"","url":"https://api.github.com/users/justjacksonn","html_url":"https://github.com/justjacksonn","followers_url":"https://api.github.com/users/justjacksonn/followers","following_url":"https://api.github.com/users/justjacksonn/following{/other_user}","gists_url":"https://api.github.com/users/justjacksonn/gists{/gist_id}","starred_url":"https://api.github.com/users/justjacksonn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/justjacksonn/subscriptions","organizations_url":"https://api.github.com/users/justjacksonn/orgs","repos_url":"https://api.github.com/users/justjacksonn/repos","events_url":"https://api.github.com/users/justjacksonn/events{/privacy}","received_events_url":"https://api.github.com/users/justjacksonn/received_events","type":"User","site_admin":false},"created_at":"2015-03-27T02:20:44Z","updated_at":"2015-03-27T02:20:44Z","body":"I would think raml2html could just create the directories instead.. if a user specifies them I would guess they mean for the directories to be there..or if not created?"}}