{"action":"created","issue":{"url":"https://api.github.com/repos/tav/asciinema2gif/issues/12","repository_url":"https://api.github.com/repos/tav/asciinema2gif","labels_url":"https://api.github.com/repos/tav/asciinema2gif/issues/12/labels{/name}","comments_url":"https://api.github.com/repos/tav/asciinema2gif/issues/12/comments","events_url":"https://api.github.com/repos/tav/asciinema2gif/issues/12/events","html_url":"https://github.com/tav/asciinema2gif/pull/12","id":137970656,"number":12,"title":"Make script work in a new way","user":{"login":"vitorgalvao","id":1699443,"avatar_url":"https://avatars.githubusercontent.com/u/1699443?v=3","gravatar_id":"","url":"https://api.github.com/users/vitorgalvao","html_url":"https://github.com/vitorgalvao","followers_url":"https://api.github.com/users/vitorgalvao/followers","following_url":"https://api.github.com/users/vitorgalvao/following{/other_user}","gists_url":"https://api.github.com/users/vitorgalvao/gists{/gist_id}","starred_url":"https://api.github.com/users/vitorgalvao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vitorgalvao/subscriptions","organizations_url":"https://api.github.com/users/vitorgalvao/orgs","repos_url":"https://api.github.com/users/vitorgalvao/repos","events_url":"https://api.github.com/users/vitorgalvao/events{/privacy}","received_events_url":"https://api.github.com/users/vitorgalvao/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-03-02T19:38:18Z","updated_at":"2016-03-03T20:05:28Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/tav/asciinema2gif/pulls/12","html_url":"https://github.com/tav/asciinema2gif/pull/12","diff_url":"https://github.com/tav/asciinema2gif/pull/12.diff","patch_url":"https://github.com/tav/asciinema2gif/pull/12.patch"},"body":"This PR expands on https://github.com/tav/asciinema2gif/pull/9 (doing it on a separate PR since it doesn’t only make fixes, but also changes). Either this one should be merged and #9 closed, or vice-versa.\r\n\r\nThis includes all the commits of #9 and adds others.\r\n\r\nMain considerations and changes:\r\n\r\n1. Spawning a new shell just to use a temporary directory makes little sense. Instead, use `pushd` and `popd`.\r\n2. Leaving the gif in the temporary directory also makes little sense. It now ends by default in the current directory, but there’s a flag to let the user specify a location and name.\r\n3. Since the URL has to follow a specific pattern, there’s no use in requiring the user to paste it in. Simply input the cast’s number. This also saves from the mistake of inserting the URL from the website.\r\n4. Having to pass URL parameters on the command line isn’t exactly user friendly. Worse still since you’d have to consult the web to verify what those are, in case you forget. Those options are now handled by flags in the script itself.\r\n\r\nIn all, this should make the script more consistent with other scripts, and more straightforward to both use and understand the options."},"comment":{"url":"https://api.github.com/repos/tav/asciinema2gif/issues/comments/191940096","html_url":"https://github.com/tav/asciinema2gif/pull/12#issuecomment-191940096","issue_url":"https://api.github.com/repos/tav/asciinema2gif/issues/12","id":191940096,"user":{"login":"vitorgalvao","id":1699443,"avatar_url":"https://avatars.githubusercontent.com/u/1699443?v=3","gravatar_id":"","url":"https://api.github.com/users/vitorgalvao","html_url":"https://github.com/vitorgalvao","followers_url":"https://api.github.com/users/vitorgalvao/followers","following_url":"https://api.github.com/users/vitorgalvao/following{/other_user}","gists_url":"https://api.github.com/users/vitorgalvao/gists{/gist_id}","starred_url":"https://api.github.com/users/vitorgalvao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vitorgalvao/subscriptions","organizations_url":"https://api.github.com/users/vitorgalvao/orgs","repos_url":"https://api.github.com/users/vitorgalvao/repos","events_url":"https://api.github.com/users/vitorgalvao/events{/privacy}","received_events_url":"https://api.github.com/users/vitorgalvao/received_events","type":"User","site_admin":false},"created_at":"2016-03-03T20:05:28Z","updated_at":"2016-03-03T20:05:28Z","body":"@wong2 Made four minor changes (also reflected them in the top post):\r\n\r\n+ Instead of `pushd` and `podp`, simply `cd` once. Even if we `cd` to another directory in the script, we’ll be left in the current directory when the script is done, so there’s no need to move back.\r\n+ Instead of using `mv` to put the gif in the right place, just make `gifsicle` do it directly (no reason not to).\r\n+ Use `--output` in `gifsicle`, instead of `>` (it’s more correct to use the tool’s flags).\r\n+ Tidied messages a bit (no point in telling a user we’re changing to a temporary directory)."}}