{"action":"created","issue":{"url":"https://api.github.com/repos/alexellis/faas-cli/issues/66","repository_url":"https://api.github.com/repos/alexellis/faas-cli","labels_url":"https://api.github.com/repos/alexellis/faas-cli/issues/66/labels{/name}","comments_url":"https://api.github.com/repos/alexellis/faas-cli/issues/66/comments","events_url":"https://api.github.com/repos/alexellis/faas-cli/issues/66/events","html_url":"https://github.com/alexellis/faas-cli/pull/66","id":254889852,"number":66,"title":"Remove master.zip file after building function with faas-cli build","user":{"login":"ems5311","id":1483261,"avatar_url":"https://avatars2.githubusercontent.com/u/1483261?v=4","gravatar_id":"","url":"https://api.github.com/users/ems5311","html_url":"https://github.com/ems5311","followers_url":"https://api.github.com/users/ems5311/followers","following_url":"https://api.github.com/users/ems5311/following{/other_user}","gists_url":"https://api.github.com/users/ems5311/gists{/gist_id}","starred_url":"https://api.github.com/users/ems5311/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ems5311/subscriptions","organizations_url":"https://api.github.com/users/ems5311/orgs","repos_url":"https://api.github.com/users/ems5311/repos","events_url":"https://api.github.com/users/ems5311/events{/privacy}","received_events_url":"https://api.github.com/users/ems5311/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-09-03T17:51:13Z","updated_at":"2017-09-04T20:26:16Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/alexellis/faas-cli/pulls/66","html_url":"https://github.com/alexellis/faas-cli/pull/66","diff_url":"https://github.com/alexellis/faas-cli/pull/66.diff","patch_url":"https://github.com/alexellis/faas-cli/pull/66.patch"},"body":"<!--- Provide a general summary of your changes in the Title above -->\r\nThis change will remove the master.zip file after the `fetchTemplates()` function is done creating the templates from the downloaded zip file.\r\n\r\n## Description\r\n<!--- Describe your changes in detail -->\r\nUse the `os.Remove()` function to remove the zip file, whose name is now stored in a const variable, after making sure that the zip file is still present with `os.Stat()`\r\n\r\n## Motivation and Context\r\n<!--- Why is this change required? What problem does it solve? -->\r\n<!--- If it fixes an open issue, please link to the issue here. -->\r\n- [ ] I have raised an issue to propose this change ([required](https://github.com/alexellis/faas/blob/master/CONTRIBUTING.md))\r\nNoticed the zip file hanging around, was confused as to its necessity to remain the directory. However, as long as the `templates` directory is present in your YAML build file location, the `master.zip` file will not be used. Therefore, it is not necessary to keep it around.\r\n\r\n## How Has This Been Tested?\r\n<!--- Please describe in detail how you tested your changes. -->\r\n<!--- Include details of your testing environment, and the tests you ran to -->\r\n<!--- see how your change affects other areas of the code, etc. -->\r\nTried building the node, python, csharp, ruby, and Dockerfile templates, and checked that the master.zip file was removed, but the function worked when deployed.\r\n\r\n## Types of changes\r\n<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->\r\n- [X] Bug fix (non-breaking change which fixes an issue)\r\n- [ ] New feature (non-breaking change which adds functionality)\r\n- [ ] Breaking change (fix or feature that would cause existing functionality to change)\r\n\r\n## Checklist:\r\n<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->\r\n<!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->\r\n- [X] My code follows the code style of this project.\r\n- [ ] My change requires a change to the documentation.\r\n- [ ] I have updated the documentation accordingly.\r\n- [X] I've read the [CONTRIBUTION](https://github.com/alexellis/faas/blob/master/CONTRIBUTING.md) guide\r\n- [X] I have signed-off my commits with `git commit -s`\r\n- [ ] I have added tests to cover my changes.\r\n- [X] All new and existing tests passed."},"comment":{"url":"https://api.github.com/repos/alexellis/faas-cli/issues/comments/327024313","html_url":"https://github.com/alexellis/faas-cli/pull/66#issuecomment-327024313","issue_url":"https://api.github.com/repos/alexellis/faas-cli/issues/66","id":327024313,"user":{"login":"alexellis","id":6358735,"avatar_url":"https://avatars1.githubusercontent.com/u/6358735?v=4","gravatar_id":"","url":"https://api.github.com/users/alexellis","html_url":"https://github.com/alexellis","followers_url":"https://api.github.com/users/alexellis/followers","following_url":"https://api.github.com/users/alexellis/following{/other_user}","gists_url":"https://api.github.com/users/alexellis/gists{/gist_id}","starred_url":"https://api.github.com/users/alexellis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexellis/subscriptions","organizations_url":"https://api.github.com/users/alexellis/orgs","repos_url":"https://api.github.com/users/alexellis/repos","events_url":"https://api.github.com/users/alexellis/events{/privacy}","received_events_url":"https://api.github.com/users/alexellis/received_events","type":"User","site_admin":false},"created_at":"2017-09-04T20:26:16Z","updated_at":"2017-09-04T20:26:16Z","author_association":"OWNER","body":"I thought that's what they were - so let's make the code self-documenting and use that variable name.\r\n\r\nI still need to look at the os.Stat line as I'm still not clear why we're clearing the error. \r\n\r\nOtherwise very excited to see these tests emerging. "}}
{"actor":{"display_login":"alexellis"}}