{"action":"created","issue":{"url":"https://api.github.com/repos/caskroom/homebrew-cask/issues/19180","repository_url":"https://api.github.com/repos/caskroom/homebrew-cask","labels_url":"https://api.github.com/repos/caskroom/homebrew-cask/issues/19180/labels{/name}","comments_url":"https://api.github.com/repos/caskroom/homebrew-cask/issues/19180/comments","events_url":"https://api.github.com/repos/caskroom/homebrew-cask/issues/19180/events","html_url":"https://github.com/caskroom/homebrew-cask/issues/19180","id":135976480,"number":19180,"title":"Request: Add ability to give administrator password to sudo","user":{"login":"mattbell87","id":2722612,"avatar_url":"https://avatars.githubusercontent.com/u/2722612?v=3","gravatar_id":"","url":"https://api.github.com/users/mattbell87","html_url":"https://github.com/mattbell87","followers_url":"https://api.github.com/users/mattbell87/followers","following_url":"https://api.github.com/users/mattbell87/following{/other_user}","gists_url":"https://api.github.com/users/mattbell87/gists{/gist_id}","starred_url":"https://api.github.com/users/mattbell87/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattbell87/subscriptions","organizations_url":"https://api.github.com/users/mattbell87/orgs","repos_url":"https://api.github.com/users/mattbell87/repos","events_url":"https://api.github.com/users/mattbell87/events{/privacy}","received_events_url":"https://api.github.com/users/mattbell87/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-02-24T06:59:34Z","updated_at":"2016-02-24T07:19:09Z","closed_at":null,"body":"Hi All,\r\n\r\nI'm currently building a GUI setup script in QT for my team to automatically install some apps through Homebrew. I want my GUI app to ask for the administrator password. The problem is when `sudo` is called for some apps, there's no easy or reliable way I can see to insert the password.\r\n\r\nWith **bash** scripts I use this method: https://gist.github.com/mattbell87/90a54e968ed39c9bdf6b which I tried however Homebrew and Cask are written in ruby and wont adhere to the bash function as sudo is called directly.\r\n\r\nPerhaps a new environment variable (or similar feature) could be added to Homebrew Cask, that when set it will pipe in the password whenever sudo is called.\r\n\r\nHere is an example of a program that needs sudo to install:\r\n```\r\nRunning: brew cask install avast\r\n==> Downloading http://download.ff.avast.com/mac/avast_free_mac_security.dmg\r\n\r\n==> No checksum defined for Cask avast, skipping verification\r\n\r\n==> Running installer for avast; your password may be necessary.\r\n==> Package installers may write to any location; options such as --appdir are ignored.\r\n\r\nError: Command failed to execute!\r\n\r\n==> Failed command:\r\n[\"/usr/bin/sudo\", \"-E\", \"--\", \"/usr/sbin/installer\", \"-pkg\", \"#<Pathname:/opt/homebrew-cask/Caskroom/avast/latest/Avast Mac Security.pkg>\", \"-target\", \"/\"]\r\n\r\n==> Output of failed command:\r\n\r\n\r\n==> Exit status of failed command:\r\n#<Process::Status: pid 8735 exit 1>\r\n\r\n==> sudo: no tty present and no askpass program specified\r\n\r\n\r\n'brew cask install avast' exited abnormally with code 1\r\n```\r\n\r\nMy apologies if it's been asked already, I searched the open and closed issues and couldn't see anything."},"comment":{"url":"https://api.github.com/repos/caskroom/homebrew-cask/issues/comments/188115360","html_url":"https://github.com/caskroom/homebrew-cask/issues/19180#issuecomment-188115360","issue_url":"https://api.github.com/repos/caskroom/homebrew-cask/issues/19180","id":188115360,"user":{"login":"adidalal","id":2555394,"avatar_url":"https://avatars.githubusercontent.com/u/2555394?v=3","gravatar_id":"","url":"https://api.github.com/users/adidalal","html_url":"https://github.com/adidalal","followers_url":"https://api.github.com/users/adidalal/followers","following_url":"https://api.github.com/users/adidalal/following{/other_user}","gists_url":"https://api.github.com/users/adidalal/gists{/gist_id}","starred_url":"https://api.github.com/users/adidalal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adidalal/subscriptions","organizations_url":"https://api.github.com/users/adidalal/orgs","repos_url":"https://api.github.com/users/adidalal/repos","events_url":"https://api.github.com/users/adidalal/events{/privacy}","received_events_url":"https://api.github.com/users/adidalal/received_events","type":"User","site_admin":false},"created_at":"2016-02-24T07:19:09Z","updated_at":"2016-02-24T07:19:09Z","body":"#5667 had some discussion, I think.\r\n\r\nSorry, not too familiar with the issue, but does something like [this](https://github.com/mathiasbynens/dotfiles/blob/master/.osx#L9) work? (Haven't looked into things, just an idea off the top of my head)"}}