{"action":"created","comment":{"url":"https://api.github.com/repos/TerraME/terrame/pulls/comments/153892125","pull_request_review_id":79967403,"id":153892125,"diff_hunk":"@@ -67,6 +77,114 @@ local function setZeroBranePreferences()\n \tfile = File(zbpreferencespath)\n \n \tfile:writeLine(table.concat(output, \"\\n\"))\n+\tfile:close()\n+end\n+\n+local function setupPackageFile(fileName, previousFile, nextFile)\n+\tlocal file = File(fileName)\n+\tlocal line = file:readLine()\n+\tlocal fileBegin = line\n+\tlocal output = {}\n+\ttable.insert(output, string.format(\"--[[ [previous](%s) | [contents](00-contents.lua) | [next](%s) ]]\\n\", previousFile, nextFile))\n+\tfoundLicense = false\n+\tfor _ = 1, licenseTextLines do\n+\t\tif not line then\n+\t\t\tbreak\n+\t\tend\n+\n+\t\tif string.find(line, licenseTextPart) then\n+\t\t\tfoundLicense = true\n+\t\tend\n+\n+\t\tline = file:readLine()\n+\tend\n+\n+\tif foundLicense then\n+\t\tline = file:readLine() -- after license\n+\telse\n+\t\tline = fileBegin -- back to begin to read all file\n+\tend\n+\n+\twhile line do\n+\t\ttable.insert(output, line)\n+\t\tline = file:readLine()\n+\tend\n+\n+\tfile:close()\n+\tfile = File(fileName)\n+\tlocal contents = table.concat(output, \"\\n\")\n+\tfile:writeLine(contents)\n+\tfile:close()\n+end\n+\n+local function createPackageIndex(packageName, packageExamplesPath, luaFiles, title)\n+\tlocal file = File(packageExamplesPath..\"/00-contents.lua\")\n+\tfile:writeLine(\"--[[ [previous](00-contents.lua) | [back to index](../welcome.lua) | [next](\"..luaFiles[1].indexed..\")\")\n+\tfile:writeLine(\"\\n# \".._Gtme.stringToLabel(title)..\" of \".._Gtme.stringToLabel(packageName)..\"\\n\")\n+\tfor i = 1, #luaFiles do\n+\t\tfile:writeLine(string.format(\"(%02d) [%s](%s)\", i, string.gsub(luaFiles[i].fileName, \".lua\", \"\"), luaFiles[i].indexed))\n+\tend\n+\n+\tfile:writeLine(\"]]\")\n+\tfile:close()\n+end\n+\n+local function copyPackage(packageName, examplesPath, subfolders)\n+\tforEachElement(subfolders, function(_, subfolder)\n+\t\tlocal packagePath = Directory(packageInfo(packageName).path..\"/\"..subfolder)\n+\t\tlocal folder = subfolder\n+\t\tif folder == \"data\" then\n+\t\t\tfolder = \"projects\"\n+\t\tend\n+\n+\t\tlocal outputDir = Directory(examplesPath..\"/\"..packageName..\"-\"..folder)\n+\t\tif not outputDir:exists() then\n+\t\t\toutputDir:create()\n+\t\tend\n+\n+\t\tos.execute(\"cp -r \"..packagePath..\"/*.{tme,lua} \"..outputDir)\n+\t\tlocal files = outputDir:list()\n+\t\tlocal luaFiles = {}\n+\t\tif #files > 0 then\n+\t\t\ttable.sort(files, function(f1, f2)\n+\t\t\t\treturn f1 < f2\n+\t\t\tend)\n+\n+\t\t\tlocal index = 0\n+\t\t\tforEachElement(files, function(_, fileName)\n+\t\t\t\tif not File(packagePath..fileName):exists() then\n+\t\t\t\t\treturn\n+\t\t\t\tend\n+\n+\t\t\t\tif string.endswith(fileName, \".lua\") then\n+\t\t\t\t\tindex = index+1","path":"src/lua/zerobrane.lua","position":134,"original_position":134,"commit_id":"203da6180eb66a2b25c2e387ffe2aee1ba421611","original_commit_id":"203da6180eb66a2b25c2e387ffe2aee1ba421611","user":{"login":"pedro-andrade-inpe","id":8777631,"avatar_url":"https://avatars3.githubusercontent.com/u/8777631?v=4","gravatar_id":"","url":"https://api.github.com/users/pedro-andrade-inpe","html_url":"https://github.com/pedro-andrade-inpe","followers_url":"https://api.github.com/users/pedro-andrade-inpe/followers","following_url":"https://api.github.com/users/pedro-andrade-inpe/following{/other_user}","gists_url":"https://api.github.com/users/pedro-andrade-inpe/gists{/gist_id}","starred_url":"https://api.github.com/users/pedro-andrade-inpe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pedro-andrade-inpe/subscriptions","organizations_url":"https://api.github.com/users/pedro-andrade-inpe/orgs","repos_url":"https://api.github.com/users/pedro-andrade-inpe/repos","events_url":"https://api.github.com/users/pedro-andrade-inpe/events{/privacy}","received_events_url":"https://api.github.com/users/pedro-andrade-inpe/received_events","type":"User","site_admin":false},"body":"```lua\r\nindex = index + 1\r\n```","created_at":"2017-11-29T19:33:12Z","updated_at":"2017-11-29T19:40:35Z","html_url":"https://github.com/TerraME/terrame/pull/2078#discussion_r153892125","pull_request_url":"https://api.github.com/repos/TerraME/terrame/pulls/2078","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/TerraME/terrame/pulls/comments/153892125"},"html":{"href":"https://github.com/TerraME/terrame/pull/2078#discussion_r153892125"},"pull_request":{"href":"https://api.github.com/repos/TerraME/terrame/pulls/2078"}}},"pull_request":{"url":"https://api.github.com/repos/TerraME/terrame/pulls/2078","id":155376938,"html_url":"https://github.com/TerraME/terrame/pull/2078","diff_url":"https://github.com/TerraME/terrame/pull/2078.diff","patch_url":"https://github.com/TerraME/terrame/pull/2078.patch","issue_url":"https://api.github.com/repos/TerraME/terrame/issues/2078","number":2078,"state":"open","locked":false,"title":"Zerobrane IDE","user":{"login":"wsenafranca","id":4280781,"avatar_url":"https://avatars3.githubusercontent.com/u/4280781?v=4","gravatar_id":"","url":"https://api.github.com/users/wsenafranca","html_url":"https://github.com/wsenafranca","followers_url":"https://api.github.com/users/wsenafranca/followers","following_url":"https://api.github.com/users/wsenafranca/following{/other_user}","gists_url":"https://api.github.com/users/wsenafranca/gists{/gist_id}","starred_url":"https://api.github.com/users/wsenafranca/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wsenafranca/subscriptions","organizations_url":"https://api.github.com/users/wsenafranca/orgs","repos_url":"https://api.github.com/users/wsenafranca/repos","events_url":"https://api.github.com/users/wsenafranca/events{/privacy}","received_events_url":"https://api.github.com/users/wsenafranca/received_events","type":"User","site_admin":false},"body":"- [x] #2060 \r\n- [ ] #2066 \r\n","created_at":"2017-11-29T15:48:53Z","updated_at":"2017-11-29T19:40:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0a141f948e12b3b09b259c58e16e812e6db1dde8","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/TerraME/terrame/pulls/2078/commits","review_comments_url":"https://api.github.com/repos/TerraME/terrame/pulls/2078/comments","review_comment_url":"https://api.github.com/repos/TerraME/terrame/pulls/comments{/number}","comments_url":"https://api.github.com/repos/TerraME/terrame/issues/2078/comments","statuses_url":"https://api.github.com/repos/TerraME/terrame/statuses/203da6180eb66a2b25c2e387ffe2aee1ba421611","head":{"label":"wsenafranca:master","ref":"master","sha":"203da6180eb66a2b25c2e387ffe2aee1ba421611","user":{"login":"wsenafranca","id":4280781,"avatar_url":"https://avatars3.githubusercontent.com/u/4280781?v=4","gravatar_id":"","url":"https://api.github.com/users/wsenafranca","html_url":"https://github.com/wsenafranca","followers_url":"https://api.github.com/users/wsenafranca/followers","following_url":"https://api.github.com/users/wsenafranca/following{/other_user}","gists_url":"https://api.github.com/users/wsenafranca/gists{/gist_id}","starred_url":"https://api.github.com/users/wsenafranca/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wsenafranca/subscriptions","organizations_url":"https://api.github.com/users/wsenafranca/orgs","repos_url":"https://api.github.com/users/wsenafranca/repos","events_url":"https://api.github.com/users/wsenafranca/events{/privacy}","received_events_url":"https://api.github.com/users/wsenafranca/received_events","type":"User","site_admin":false},"repo":{"id":111098517,"name":"terrame","full_name":"wsenafranca/terrame","owner":{"login":"wsenafranca","id":4280781,"avatar_url":"https://avatars3.githubusercontent.com/u/4280781?v=4","gravatar_id":"","url":"https://api.github.com/users/wsenafranca","html_url":"https://github.com/wsenafranca","followers_url":"https://api.github.com/users/wsenafranca/followers","following_url":"https://api.github.com/users/wsenafranca/following{/other_user}","gists_url":"https://api.github.com/users/wsenafranca/gists{/gist_id}","starred_url":"https://api.github.com/users/wsenafranca/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wsenafranca/subscriptions","organizations_url":"https://api.github.com/users/wsenafranca/orgs","repos_url":"https://api.github.com/users/wsenafranca/repos","events_url":"https://api.github.com/users/wsenafranca/events{/privacy}","received_events_url":"https://api.github.com/users/wsenafranca/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/wsenafranca/terrame","description":"TerraME is a programming environment for spatial dynamical modelling","fork":true,"url":"https://api.github.com/repos/wsenafranca/terrame","forks_url":"https://api.github.com/repos/wsenafranca/terrame/forks","keys_url":"https://api.github.com/repos/wsenafranca/terrame/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wsenafranca/terrame/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wsenafranca/terrame/teams","hooks_url":"https://api.github.com/repos/wsenafranca/terrame/hooks","issue_events_url":"https://api.github.com/repos/wsenafranca/terrame/issues/events{/number}","events_url":"https://api.github.com/repos/wsenafranca/terrame/events","assignees_url":"https://api.github.com/repos/wsenafranca/terrame/assignees{/user}","branches_url":"https://api.github.com/repos/wsenafranca/terrame/branches{/branch}","tags_url":"https://api.github.com/repos/wsenafranca/terrame/tags","blobs_url":"https://api.github.com/repos/wsenafranca/terrame/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wsenafranca/terrame/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wsenafranca/terrame/git/refs{/sha}","trees_url":"https://api.github.com/repos/wsenafranca/terrame/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wsenafranca/terrame/statuses/{sha}","languages_url":"https://api.github.com/repos/wsenafranca/terrame/languages","stargazers_url":"https://api.github.com/repos/wsenafranca/terrame/stargazers","contributors_url":"https://api.github.com/repos/wsenafranca/terrame/contributors","subscribers_url":"https://api.github.com/repos/wsenafranca/terrame/subscribers","subscription_url":"https://api.github.com/repos/wsenafranca/terrame/subscription","commits_url":"https://api.github.com/repos/wsenafranca/terrame/commits{/sha}","git_commits_url":"https://api.github.com/repos/wsenafranca/terrame/git/commits{/sha}","comments_url":"https://api.github.com/repos/wsenafranca/terrame/comments{/number}","issue_comment_url":"https://api.github.com/repos/wsenafranca/terrame/issues/comments{/number}","contents_url":"https://api.github.com/repos/wsenafranca/terrame/contents/{+path}","compare_url":"https://api.github.com/repos/wsenafranca/terrame/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wsenafranca/terrame/merges","archive_url":"https://api.github.com/repos/wsenafranca/terrame/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wsenafranca/terrame/downloads","issues_url":"https://api.github.com/repos/wsenafranca/terrame/issues{/number}","pulls_url":"https://api.github.com/repos/wsenafranca/terrame/pulls{/number}","milestones_url":"https://api.github.com/repos/wsenafranca/terrame/milestones{/number}","notifications_url":"https://api.github.com/repos/wsenafranca/terrame/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wsenafranca/terrame/labels{/name}","releases_url":"https://api.github.com/repos/wsenafranca/terrame/releases{/id}","deployments_url":"https://api.github.com/repos/wsenafranca/terrame/deployments","created_at":"2017-11-17T11:58:37Z","updated_at":"2017-11-17T11:58:43Z","pushed_at":"2017-11-29T15:46:12Z","git_url":"git://github.com/wsenafranca/terrame.git","ssh_url":"git@github.com:wsenafranca/terrame.git","clone_url":"https://github.com/wsenafranca/terrame.git","svn_url":"https://github.com/wsenafranca/terrame","homepage":"www.terrame.org","size":56125,"stargazers_count":0,"watchers_count":0,"language":"Lua","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"TerraME:master","ref":"master","sha":"b5f317173805fcb235f4c2f3d57b2a719135d20b","user":{"login":"TerraME","id":12460064,"avatar_url":"https://avatars3.githubusercontent.com/u/12460064?v=4","gravatar_id":"","url":"https://api.github.com/users/TerraME","html_url":"https://github.com/TerraME","followers_url":"https://api.github.com/users/TerraME/followers","following_url":"https://api.github.com/users/TerraME/following{/other_user}","gists_url":"https://api.github.com/users/TerraME/gists{/gist_id}","starred_url":"https://api.github.com/users/TerraME/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TerraME/subscriptions","organizations_url":"https://api.github.com/users/TerraME/orgs","repos_url":"https://api.github.com/users/TerraME/repos","events_url":"https://api.github.com/users/TerraME/events{/privacy}","received_events_url":"https://api.github.com/users/TerraME/received_events","type":"Organization","site_admin":false},"repo":{"id":24053422,"name":"terrame","full_name":"TerraME/terrame","owner":{"login":"TerraME","id":12460064,"avatar_url":"https://avatars3.githubusercontent.com/u/12460064?v=4","gravatar_id":"","url":"https://api.github.com/users/TerraME","html_url":"https://github.com/TerraME","followers_url":"https://api.github.com/users/TerraME/followers","following_url":"https://api.github.com/users/TerraME/following{/other_user}","gists_url":"https://api.github.com/users/TerraME/gists{/gist_id}","starred_url":"https://api.github.com/users/TerraME/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TerraME/subscriptions","organizations_url":"https://api.github.com/users/TerraME/orgs","repos_url":"https://api.github.com/users/TerraME/repos","events_url":"https://api.github.com/users/TerraME/events{/privacy}","received_events_url":"https://api.github.com/users/TerraME/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/TerraME/terrame","description":"TerraME is a programming environment for spatial dynamical modelling","fork":false,"url":"https://api.github.com/repos/TerraME/terrame","forks_url":"https://api.github.com/repos/TerraME/terrame/forks","keys_url":"https://api.github.com/repos/TerraME/terrame/keys{/key_id}","collaborators_url":"https://api.github.com/repos/TerraME/terrame/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/TerraME/terrame/teams","hooks_url":"https://api.github.com/repos/TerraME/terrame/hooks","issue_events_url":"https://api.github.com/repos/TerraME/terrame/issues/events{/number}","events_url":"https://api.github.com/repos/TerraME/terrame/events","assignees_url":"https://api.github.com/repos/TerraME/terrame/assignees{/user}","branches_url":"https://api.github.com/repos/TerraME/terrame/branches{/branch}","tags_url":"https://api.github.com/repos/TerraME/terrame/tags","blobs_url":"https://api.github.com/repos/TerraME/terrame/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/TerraME/terrame/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/TerraME/terrame/git/refs{/sha}","trees_url":"https://api.github.com/repos/TerraME/terrame/git/trees{/sha}","statuses_url":"https://api.github.com/repos/TerraME/terrame/statuses/{sha}","languages_url":"https://api.github.com/repos/TerraME/terrame/languages","stargazers_url":"https://api.github.com/repos/TerraME/terrame/stargazers","contributors_url":"https://api.github.com/repos/TerraME/terrame/contributors","subscribers_url":"https://api.github.com/repos/TerraME/terrame/subscribers","subscription_url":"https://api.github.com/repos/TerraME/terrame/subscription","commits_url":"https://api.github.com/repos/TerraME/terrame/commits{/sha}","git_commits_url":"https://api.github.com/repos/TerraME/terrame/git/commits{/sha}","comments_url":"https://api.github.com/repos/TerraME/terrame/comments{/number}","issue_comment_url":"https://api.github.com/repos/TerraME/terrame/issues/comments{/number}","contents_url":"https://api.github.com/repos/TerraME/terrame/contents/{+path}","compare_url":"https://api.github.com/repos/TerraME/terrame/compare/{base}...{head}","merges_url":"https://api.github.com/repos/TerraME/terrame/merges","archive_url":"https://api.github.com/repos/TerraME/terrame/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/TerraME/terrame/downloads","issues_url":"https://api.github.com/repos/TerraME/terrame/issues{/number}","pulls_url":"https://api.github.com/repos/TerraME/terrame/pulls{/number}","milestones_url":"https://api.github.com/repos/TerraME/terrame/milestones{/number}","notifications_url":"https://api.github.com/repos/TerraME/terrame/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/TerraME/terrame/labels{/name}","releases_url":"https://api.github.com/repos/TerraME/terrame/releases{/id}","deployments_url":"https://api.github.com/repos/TerraME/terrame/deployments","created_at":"2014-09-15T11:12:11Z","updated_at":"2017-10-16T12:30:39Z","pushed_at":"2017-11-29T19:24:07Z","git_url":"git://github.com/TerraME/terrame.git","ssh_url":"git@github.com:TerraME/terrame.git","clone_url":"https://github.com/TerraME/terrame.git","svn_url":"https://github.com/TerraME/terrame","homepage":"www.terrame.org","size":56128,"stargazers_count":10,"watchers_count":10,"language":"Lua","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":12,"mirror_url":null,"archived":false,"open_issues_count":221,"license":{"key":"lgpl-3.0","name":"GNU Lesser General Public License v3.0","spdx_id":"LGPL-3.0","url":"https://api.github.com/licenses/lgpl-3.0"},"forks":12,"open_issues":221,"watchers":10,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/TerraME/terrame/pulls/2078"},"html":{"href":"https://github.com/TerraME/terrame/pull/2078"},"issue":{"href":"https://api.github.com/repos/TerraME/terrame/issues/2078"},"comments":{"href":"https://api.github.com/repos/TerraME/terrame/issues/2078/comments"},"review_comments":{"href":"https://api.github.com/repos/TerraME/terrame/pulls/2078/comments"},"review_comment":{"href":"https://api.github.com/repos/TerraME/terrame/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/TerraME/terrame/pulls/2078/commits"},"statuses":{"href":"https://api.github.com/repos/TerraME/terrame/statuses/203da6180eb66a2b25c2e387ffe2aee1ba421611"}},"author_association":"NONE"}}
{"actor":{"display_login":"pedro-andrade-inpe"}}