{"action":"created","issue":{"url":"https://api.github.com/repos/hermanjunge/kubernetes-digitalocean-terraform/issues/14","repository_url":"https://api.github.com/repos/hermanjunge/kubernetes-digitalocean-terraform","labels_url":"https://api.github.com/repos/hermanjunge/kubernetes-digitalocean-terraform/issues/14/labels{/name}","comments_url":"https://api.github.com/repos/hermanjunge/kubernetes-digitalocean-terraform/issues/14/comments","events_url":"https://api.github.com/repos/hermanjunge/kubernetes-digitalocean-terraform/issues/14/events","html_url":"https://github.com/hermanjunge/kubernetes-digitalocean-terraform/issues/14","id":186059403,"number":14,"title":"`BASH_REMATCH` doesn't work well with `zsh`","user":{"login":"alpe","id":28003,"avatar_url":"https://avatars.githubusercontent.com/u/28003?v=3","gravatar_id":"","url":"https://api.github.com/users/alpe","html_url":"https://github.com/alpe","followers_url":"https://api.github.com/users/alpe/followers","following_url":"https://api.github.com/users/alpe/following{/other_user}","gists_url":"https://api.github.com/users/alpe/gists{/gist_id}","starred_url":"https://api.github.com/users/alpe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alpe/subscriptions","organizations_url":"https://api.github.com/users/alpe/orgs","repos_url":"https://api.github.com/users/alpe/repos","events_url":"https://api.github.com/users/alpe/events{/privacy}","received_events_url":"https://api.github.com/users/alpe/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-10-29T04:49:38Z","updated_at":"2016-10-29T05:28:09Z","closed_at":null,"body":"See: https://github.com/hermanjunge/kubernetes-digitalocean-terraform/blob/master/setup_terraform.sh#L10\r\n\r\nThe previous condition worked better for me. I'm on OSX\r\n"},"comment":{"url":"https://api.github.com/repos/hermanjunge/kubernetes-digitalocean-terraform/issues/comments/257072324","html_url":"https://github.com/hermanjunge/kubernetes-digitalocean-terraform/issues/14#issuecomment-257072324","issue_url":"https://api.github.com/repos/hermanjunge/kubernetes-digitalocean-terraform/issues/14","id":257072324,"user":{"login":"5tefan","id":5855806,"avatar_url":"https://avatars.githubusercontent.com/u/5855806?v=3","gravatar_id":"","url":"https://api.github.com/users/5tefan","html_url":"https://github.com/5tefan","followers_url":"https://api.github.com/users/5tefan/followers","following_url":"https://api.github.com/users/5tefan/following{/other_user}","gists_url":"https://api.github.com/users/5tefan/gists{/gist_id}","starred_url":"https://api.github.com/users/5tefan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/5tefan/subscriptions","organizations_url":"https://api.github.com/users/5tefan/orgs","repos_url":"https://api.github.com/users/5tefan/repos","events_url":"https://api.github.com/users/5tefan/events{/privacy}","received_events_url":"https://api.github.com/users/5tefan/received_events","type":"User","site_admin":false},"created_at":"2016-10-29T05:28:09Z","updated_at":"2016-10-29T05:28:09Z","body":"This is similar to #10... TL;DR: Needing the `ssh-keygen -E` variant depends on OpenSSH version >= 6.9, not necessarily on OS. \r\n\r\nI don't think we should revert to the [if [[ `uname` == 'Darwin' ]]](https://github.com/hermanjunge/kubernetes-digitalocean-terraform/blob/8b364917cac1e84c14d0f03f847f52c12888284f/setup_terraform.sh) version since presumably Linux distros will eventually be using V6.9+ and this will be an issue again. \r\n\r\nA potential solution might be to use this [reMatch function](http://stackoverflow.com/a/22539067/2177568):\r\n```\r\n# SYNOPSIS\r\n#   reMatch string regex\r\n# DESCRIPTION\r\n#   Multi-shell implementation of the =~ regex-matching operator;\r\n#   works in: bash, ksh, zsh\r\n#\r\n#   Matches STRING against REGEX and returns exit code 0 if they match.\r\n#   Additionally, the matched string(s) is returned in array variable ${reMatch[@]},\r\n#   which works the same as bash's ${BASH_REMATCH[@]} variable: the overall\r\n#   match is stored in the 1st element of ${reMatch[@]}, with matches for\r\n#   capture groups (parenthesized subexpressions), if any, stored in the remaining\r\n#   array elements.\r\n#   NOTE: zsh arrays by default start with index *1*.\r\n# EXAMPLE:\r\n#   reMatch 'This AND that.' '^(.+) AND (.+)\\.' # -> ${reMatch[@]} == ('This AND that.', 'This', 'that')\r\nfunction reMatch {\r\n  typeset ec\r\n  unset -v reMatch # initialize output variable\r\n  [[ $1 =~ $2 ]] # perform the regex test\r\n  ec=$? # save exit code\r\n  if [[ $ec -eq 0 ]]; then # copy result to output variable\r\n    [[ -n $BASH_VERSION ]] && reMatch=( \"${BASH_REMATCH[@]}\" )\r\n    [[ -n $KSH_VERSION ]]  && reMatch=( \"${.sh.match[@]}\" )\r\n    [[ -n $ZSH_VERSION ]]  && reMatch=( \"$MATCH\" \"${match[@]}\" )\r\n  fi\r\n  return $ec\r\n}\r\n```\r\nI haven't tested this, but this seems to be getting pretty crazy for the \"convenience script\". "}}
{"actor":{"display_login":"5tefan"}}