{"action":"created","issue":{"url":"https://api.github.com/repos/robbyrussell/oh-my-zsh/issues/4121","labels_url":"https://api.github.com/repos/robbyrussell/oh-my-zsh/issues/4121/labels{/name}","comments_url":"https://api.github.com/repos/robbyrussell/oh-my-zsh/issues/4121/comments","events_url":"https://api.github.com/repos/robbyrussell/oh-my-zsh/issues/4121/events","html_url":"https://github.com/robbyrussell/oh-my-zsh/pull/4121","id":92766628,"number":4121,"title":"chucknorris: check for fortune/strfile dependency","user":{"login":"apjanke","id":2618447,"avatar_url":"https://avatars.githubusercontent.com/u/2618447?v=3","gravatar_id":"","url":"https://api.github.com/users/apjanke","html_url":"https://github.com/apjanke","followers_url":"https://api.github.com/users/apjanke/followers","following_url":"https://api.github.com/users/apjanke/following{/other_user}","gists_url":"https://api.github.com/users/apjanke/gists{/gist_id}","starred_url":"https://api.github.com/users/apjanke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apjanke/subscriptions","organizations_url":"https://api.github.com/users/apjanke/orgs","repos_url":"https://api.github.com/users/apjanke/repos","events_url":"https://api.github.com/users/apjanke/events{/privacy}","received_events_url":"https://api.github.com/users/apjanke/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-07-03T00:46:30Z","updated_at":"2015-07-05T00:30:08Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/robbyrussell/oh-my-zsh/pulls/4121","html_url":"https://github.com/robbyrussell/oh-my-zsh/pull/4121","diff_url":"https://github.com/robbyrussell/oh-my-zsh/pull/4121.diff","patch_url":"https://github.com/robbyrussell/oh-my-zsh/pull/4121.patch"},"body":"Fixes #4112\r\nDepends on #3611 \r\n\r\nThis plugin depends on fortune and strfile, which is part of fortune. But that's not immediately obvious to many users, per #4112.\r\n\r\nThis PR has chucknorris check for `strfile` when it needs it, and if not found, issue a more helpful error message that suggests a \"fortune\" package, and doesn't attempt to use strfile to update the fortunes dir. Still puts the aliases in place, since they'll produce more obvious error messages if used when `fortune` is not installed.\r\n\r\nAlso handles Cygwin installing `strfile` to `/usr/sbin`, which is not on the path by default, by directly checking for `/usr/sbin/strfile` if the plain `strfile` command is not found.\r\n\r\nAdds an anonymous function for hygiene, to avoid clobbering the global `$DIR` variable, and uses a less-likely-to-collide `$CHUCKNORRIS_PLUGIN_DIR` temporary global for where it needs to access `$0` outside the anonymous function.\r\n\r\nCC @maff, since you're the original chucknorris plugin author.\r\n"},"comment":{"url":"https://api.github.com/repos/robbyrussell/oh-my-zsh/issues/comments/118566957","html_url":"https://github.com/robbyrussell/oh-my-zsh/pull/4121#issuecomment-118566957","issue_url":"https://api.github.com/repos/robbyrussell/oh-my-zsh/issues/4121","id":118566957,"user":{"login":"apjanke","id":2618447,"avatar_url":"https://avatars.githubusercontent.com/u/2618447?v=3","gravatar_id":"","url":"https://api.github.com/users/apjanke","html_url":"https://github.com/apjanke","followers_url":"https://api.github.com/users/apjanke/followers","following_url":"https://api.github.com/users/apjanke/following{/other_user}","gists_url":"https://api.github.com/users/apjanke/gists{/gist_id}","starred_url":"https://api.github.com/users/apjanke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apjanke/subscriptions","organizations_url":"https://api.github.com/users/apjanke/orgs","repos_url":"https://api.github.com/users/apjanke/repos","events_url":"https://api.github.com/users/apjanke/events{/privacy}","received_events_url":"https://api.github.com/users/apjanke/received_events","type":"User","site_admin":false},"created_at":"2015-07-05T00:30:08Z","updated_at":"2015-07-05T00:30:08Z","body":"Thanks! :)"}}