{"action":"created","issue":{"url":"https://api.github.com/repos/jorangreef/sudo-prompt/issues/44","repository_url":"https://api.github.com/repos/jorangreef/sudo-prompt","labels_url":"https://api.github.com/repos/jorangreef/sudo-prompt/issues/44/labels{/name}","comments_url":"https://api.github.com/repos/jorangreef/sudo-prompt/issues/44/comments","events_url":"https://api.github.com/repos/jorangreef/sudo-prompt/issues/44/events","html_url":"https://github.com/jorangreef/sudo-prompt/issues/44","id":213900968,"number":44,"title":"Executing a sudo command like \"sudo -v\"","user":{"login":"theskyliner","id":8366071,"avatar_url":"https://avatars3.githubusercontent.com/u/8366071?v=3","gravatar_id":"","url":"https://api.github.com/users/theskyliner","html_url":"https://github.com/theskyliner","followers_url":"https://api.github.com/users/theskyliner/followers","following_url":"https://api.github.com/users/theskyliner/following{/other_user}","gists_url":"https://api.github.com/users/theskyliner/gists{/gist_id}","starred_url":"https://api.github.com/users/theskyliner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/theskyliner/subscriptions","organizations_url":"https://api.github.com/users/theskyliner/orgs","repos_url":"https://api.github.com/users/theskyliner/repos","events_url":"https://api.github.com/users/theskyliner/events{/privacy}","received_events_url":"https://api.github.com/users/theskyliner/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-03-13T21:20:52Z","updated_at":"2017-03-15T14:58:08Z","closed_at":null,"body":"Hey there,\r\n\r\nthanks for this awesome package!\r\n\r\nI have a homebrew script to switch between php versions on my macbook.\r\nYou can't execute the script with sudo, so the normal command would be `phpswitch.sh 70` in order to switch to php 7.0.\r\n\r\nBut at the end of the script the apache config is updated and the apache will be restarted. So the script needs root rights.\r\n\r\nI search for some workaround and I found the possibility to call `sudo -v` first, so the root password is prompted and then executing the phpswitch script, because then the timestamp for sudo is already valid.\r\n\r\nNow the problem with this workaround: with your package I cant call `sudo.exec('sudo -v')` nor `sudo.exec('-v')`.\r\n\r\nDo you have any idea how I could achieve this?\r\n\r\nThanks in advance!"},"comment":{"url":"https://api.github.com/repos/jorangreef/sudo-prompt/issues/comments/286768128","html_url":"https://github.com/jorangreef/sudo-prompt/issues/44#issuecomment-286768128","issue_url":"https://api.github.com/repos/jorangreef/sudo-prompt/issues/44","id":286768128,"user":{"login":"jorangreef","id":413206,"avatar_url":"https://avatars3.githubusercontent.com/u/413206?v=3","gravatar_id":"","url":"https://api.github.com/users/jorangreef","html_url":"https://github.com/jorangreef","followers_url":"https://api.github.com/users/jorangreef/followers","following_url":"https://api.github.com/users/jorangreef/following{/other_user}","gists_url":"https://api.github.com/users/jorangreef/gists{/gist_id}","starred_url":"https://api.github.com/users/jorangreef/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jorangreef/subscriptions","organizations_url":"https://api.github.com/users/jorangreef/orgs","repos_url":"https://api.github.com/users/jorangreef/repos","events_url":"https://api.github.com/users/jorangreef/events{/privacy}","received_events_url":"https://api.github.com/users/jorangreef/received_events","type":"User","site_admin":false},"created_at":"2017-03-15T14:58:08Z","updated_at":"2017-03-15T14:58:08Z","body":"Thanks @theskyliner !\r\n\r\nIf I understand correctly, do you want to do the following?\r\n\r\n```\r\n# Get the sudo session established for the next few minutes:\r\nsudo -v\r\n# Run the following script without sudo for the most part.\r\n# Within this script there is a command prefixed with sudo to restart apache.\r\n./phpswitch.sh 70\r\n```"}}
{"actor":{"display_login":"jorangreef"}}