{"action":"closed","issue":{"url":"https://api.github.com/repos/faressoft/terminalizer/issues/26","repository_url":"https://api.github.com/repos/faressoft/terminalizer","labels_url":"https://api.github.com/repos/faressoft/terminalizer/issues/26/labels{/name}","comments_url":"https://api.github.com/repos/faressoft/terminalizer/issues/26/comments","events_url":"https://api.github.com/repos/faressoft/terminalizer/issues/26/events","html_url":"https://github.com/faressoft/terminalizer/issues/26","id":356088821,"node_id":"MDU6SXNzdWUzNTYwODg4MjE=","number":26,"title":"--config fails to find config file if it is a symlink","user":{"login":"mattbrictson","id":189693,"node_id":"MDQ6VXNlcjE4OTY5Mw==","avatar_url":"https://avatars0.githubusercontent.com/u/189693?v=4","gravatar_id":"","url":"https://api.github.com/users/mattbrictson","html_url":"https://github.com/mattbrictson","followers_url":"https://api.github.com/users/mattbrictson/followers","following_url":"https://api.github.com/users/mattbrictson/following{/other_user}","gists_url":"https://api.github.com/users/mattbrictson/gists{/gist_id}","starred_url":"https://api.github.com/users/mattbrictson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattbrictson/subscriptions","organizations_url":"https://api.github.com/users/mattbrictson/orgs","repos_url":"https://api.github.com/users/mattbrictson/repos","events_url":"https://api.github.com/users/mattbrictson/events{/privacy}","received_events_url":"https://api.github.com/users/mattbrictson/received_events","type":"User","site_admin":false},"labels":[{"id":1001400739,"node_id":"MDU6TGFiZWwxMDAxNDAwNzM5","url":"https://api.github.com/repos/faressoft/terminalizer/labels/enhancement","name":"enhancement","color":"a2eeef","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-08-31T18:51:11Z","updated_at":"2018-09-01T14:01:40Z","closed_at":"2018-09-01T14:01:40Z","author_association":"NONE","body":"```\r\n$ terminalizer --config path/to/config.yml record hello\r\n```\r\n\r\nIf `path/to/config.yml` is a symlink, then terminalizer fails with an error:\r\n\r\n```\r\nError: \r\n  The provided file doesn't exit\r\n\r\nHint:\r\n  Use the --help option to get help about the usage\r\n```\r\n\r\nI believe the problem is that here:\r\n\r\nhttps://github.com/faressoft/terminalizer/blob/e06c12dd2d06dc43ef55a5a7e90d2ddc97db8a4a/utility.js#L13-L28\r\n\r\n`fs.lstatSync` is being used, where `fs.statSync` should be used instead.\r\n\r\nFrom the [stat manpage](http://man7.org/linux/man-pages/man2/stat.2.html):\r\n\r\n```\r\nThese functions return information about a file, in the buffer\r\npointed to by statbuf.  No permissions are required on the file\r\nitself, but—in the case of stat(), fstatat(), and lstat()—execute\r\n(search) permission is required on all of the directories in pathname\r\nthat lead to the file.\r\n\r\nstat() and fstatat() retrieve information about the file pointed to\r\nby pathname; the differences for fstatat() are described below.\r\n\r\nlstat() is identical to stat(), except that if pathname is a symbolic\r\nlink, then it returns information about the link itself, not the file\r\nthat it refers to.\r\n```\r\n\r\nTesting in the Node REPL:\r\n\r\n```\r\n$ node\r\n> fs.lstatSync(\"path/to/config.yml\").isFile()\r\nfalse\r\n> fs.statSync(\"path/to/config.yml\").isFile()\r\ntrue\r\n```"}}
{"actor":{"display_login":"faressoft"}}