{"action":"created","issue":{"url":"https://api.github.com/repos/Netflix-Skunkworks/go-jira/issues/166","repository_url":"https://api.github.com/repos/Netflix-Skunkworks/go-jira","labels_url":"https://api.github.com/repos/Netflix-Skunkworks/go-jira/issues/166/labels{/name}","comments_url":"https://api.github.com/repos/Netflix-Skunkworks/go-jira/issues/166/comments","events_url":"https://api.github.com/repos/Netflix-Skunkworks/go-jira/issues/166/events","html_url":"https://github.com/Netflix-Skunkworks/go-jira/issues/166","id":313092959,"number":166,"title":"--template=FOO broken in v1 on absolute paths","user":{"login":"jez","id":5544532,"avatar_url":"https://avatars2.githubusercontent.com/u/5544532?v=4","gravatar_id":"","url":"https://api.github.com/users/jez","html_url":"https://github.com/jez","followers_url":"https://api.github.com/users/jez/followers","following_url":"https://api.github.com/users/jez/following{/other_user}","gists_url":"https://api.github.com/users/jez/gists{/gist_id}","starred_url":"https://api.github.com/users/jez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jez/subscriptions","organizations_url":"https://api.github.com/users/jez/orgs","repos_url":"https://api.github.com/users/jez/repos","events_url":"https://api.github.com/users/jez/events{/privacy}","received_events_url":"https://api.github.com/users/jez/received_events","type":"User","site_admin":false},"labels":[{"id":175866386,"url":"https://api.github.com/repos/Netflix-Skunkworks/go-jira/labels/bug","name":"bug","color":"fc2929","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-04-10T21:18:50Z","updated_at":"2018-04-16T20:57:49Z","closed_at":"2018-04-16T02:31:50Z","author_association":"NONE","body":"Feeding an absolute path to the `--template` flag seems to not work.\r\nI've reproduced this with the `jira create` subcommand, but from a\r\ncursory scan of the code, I think it should affect all commands that\r\ncan customize the template.\r\n\r\nIn particular, this is problematic because\r\n\r\n- the `mktemp` command returns an absolute path within `$TMPDIR`\r\n- the `command1 <(command2)` shell syntax opens up a temporary file at\r\n  `/dev/fd/12345` to capture the subshell output from `command2` and\r\n  put into a file for `command1` to use.\r\n\r\nSo it's somewhat annoying to use temporary template files right now\r\n(the temp file has to be in the same directory that you exec the\r\n`jira` command).\r\n\r\nI do not see this behavior on v0, only on v1.\r\n\r\n### Steps to reproduce\r\n\r\n#### [OK] Same directory\r\n\r\n```bash\r\ncd ~\r\ntouch ~/foo.yml\r\njira create -p MYPROJECT --template=foo.yml\r\n```\r\n\r\n- **Expected**: `$EDITOR` should open with our (empty) template\r\n- **Actual**: `$EDITOR` opens (this case is working fine!)\r\n\r\n#### [BAD] Relative path\r\n\r\n```bash\r\ncd ~\r\nmkdir ~/my-folder\r\ntouch ~/my-folder/foo.yml\r\njira create -p MYPROJECT --template=my-folder/foo.yml\r\n```\r\n\r\n- **Expected**: `$EDITOR` should open with our (empty) template\r\n- **Actual**: Fatal error:\r\n\r\n    ```\r\n    ERROR Invalid Usage: open /var/folders/b0/43zg3s114tb1rcdfflfftg7m0000gn/T/my-folder/foo.yml987543717: no such file or directory\r\n    ```\r\n\r\n#### [BAD] Absolute path\r\n\r\n\r\n\r\n```bash\r\ncd ~\r\ntouch ~/foo.yml\r\n# Your shell will expand $HOME to an absolute path before exec'ing the command\r\njira create -p MYPROJECT --template=$HOME/foo.yml\r\n```\r\n\r\n- **Expected**: `$EDITOR` should open with our (empty) template\r\n- **Actual**: Fatal error:\r\n\r\n    ```\r\n    ERROR Invalid Usage: open /var/folders/b0/43zg3s114tb1rcdfflfftg7m0000gn/T/Users/jez/foo.yml987543717: no such file or directory\r\n    ```\r\n"},"comment":{"url":"https://api.github.com/repos/Netflix-Skunkworks/go-jira/issues/comments/381747022","html_url":"https://github.com/Netflix-Skunkworks/go-jira/issues/166#issuecomment-381747022","issue_url":"https://api.github.com/repos/Netflix-Skunkworks/go-jira/issues/166","id":381747022,"user":{"login":"jez","id":5544532,"avatar_url":"https://avatars2.githubusercontent.com/u/5544532?v=4","gravatar_id":"","url":"https://api.github.com/users/jez","html_url":"https://github.com/jez","followers_url":"https://api.github.com/users/jez/followers","following_url":"https://api.github.com/users/jez/following{/other_user}","gists_url":"https://api.github.com/users/jez/gists{/gist_id}","starred_url":"https://api.github.com/users/jez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jez/subscriptions","organizations_url":"https://api.github.com/users/jez/orgs","repos_url":"https://api.github.com/users/jez/repos","events_url":"https://api.github.com/users/jez/events{/privacy}","received_events_url":"https://api.github.com/users/jez/received_events","type":"User","site_admin":false},"created_at":"2018-04-16T20:57:49Z","updated_at":"2018-04-16T20:57:49Z","author_association":"NONE","body":"Just tried it out, and it works great now!\r\n\r\nThanks for the fast turnaround 🙂 "}}
{"actor":{"display_login":"jez"}}