{"action":"created","comment":{"url":"https://api.github.com/repos/cake-build/cake/pulls/comments/75657914","id":75657914,"diff_hunk":"@@ -128,5 +148,35 @@ private static void CopyFileCore(ICakeContext context, FilePath filePath, FilePa\n             var file = context.FileSystem.GetFile(absoluteFilePath);\n             file.Copy(absoluteTargetPath, true);\n         }\n+\n+        private static void CopyFileCore(ICakeContext context, FilePath filePath, FilePath targetFilePath, string commonPath, string targetDirectoryPath)\n+        {\n+            var absoluteFilePath = filePath.MakeAbsolute(context.Environment);\n+\n+            // Get the file.\n+            if (!context.FileSystem.Exist(absoluteFilePath))\n+            {\n+                const string format = \"The file '{0}' do not exist.\";\n+                var message = string.Format(CultureInfo.InvariantCulture, format, absoluteFilePath.FullPath);\n+                throw new FileNotFoundException(message, absoluteFilePath.FullPath);\n+            }\n+\n+            // Copy the file.\n+            var absoluteTargetPath = targetFilePath.MakeAbsolute(context.Environment);\n+            var file = context.FileSystem.GetFile(absoluteFilePath);\n+\n+            // Get the parent folder structure and create it.\n+            var newRelativeFolderPath = filePath.GetDirectory().ToString().Replace(commonPath.Replace(\"\\\\\", \"/\"), string.Empty);\n+            var newTargetPath = absoluteTargetPath.GetDirectory() + newRelativeFolderPath;","path":"src/Cake.Common/IO/FileCopier.cs","position":91,"original_position":91,"commit_id":"da15709e62e289cfa1e8dd67b5a50679984a9c71","original_commit_id":"da15709e62e289cfa1e8dd67b5a50679984a9c71","user":{"login":"patriksvensson","id":357872,"avatar_url":"https://avatars.githubusercontent.com/u/357872?v=3","gravatar_id":"","url":"https://api.github.com/users/patriksvensson","html_url":"https://github.com/patriksvensson","followers_url":"https://api.github.com/users/patriksvensson/followers","following_url":"https://api.github.com/users/patriksvensson/following{/other_user}","gists_url":"https://api.github.com/users/patriksvensson/gists{/gist_id}","starred_url":"https://api.github.com/users/patriksvensson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/patriksvensson/subscriptions","organizations_url":"https://api.github.com/users/patriksvensson/orgs","repos_url":"https://api.github.com/users/patriksvensson/repos","events_url":"https://api.github.com/users/patriksvensson/events{/privacy}","received_events_url":"https://api.github.com/users/patriksvensson/received_events","type":"User","site_admin":false},"body":"Use `absoluteTargetPath.GetDirectory().Combine(newRelativeFolderPath)` instead.","created_at":"2016-08-22T11:03:29Z","updated_at":"2016-08-22T11:03:29Z","html_url":"https://github.com/cake-build/cake/pull/1145#discussion_r75657914","pull_request_url":"https://api.github.com/repos/cake-build/cake/pulls/1145","_links":{"self":{"href":"https://api.github.com/repos/cake-build/cake/pulls/comments/75657914"},"html":{"href":"https://github.com/cake-build/cake/pull/1145#discussion_r75657914"},"pull_request":{"href":"https://api.github.com/repos/cake-build/cake/pulls/1145"}}},"pull_request":{"url":"https://api.github.com/repos/cake-build/cake/pulls/1145","id":80779726,"html_url":"https://github.com/cake-build/cake/pull/1145","diff_url":"https://github.com/cake-build/cake/pull/1145.diff","patch_url":"https://github.com/cake-build/cake/pull/1145.patch","issue_url":"https://api.github.com/repos/cake-build/cake/issues/1145","number":1145,"state":"open","locked":false,"title":"Copy directory structure","user":{"login":"maddin2016","id":19551763,"avatar_url":"https://avatars.githubusercontent.com/u/19551763?v=3","gravatar_id":"","url":"https://api.github.com/users/maddin2016","html_url":"https://github.com/maddin2016","followers_url":"https://api.github.com/users/maddin2016/followers","following_url":"https://api.github.com/users/maddin2016/following{/other_user}","gists_url":"https://api.github.com/users/maddin2016/gists{/gist_id}","starred_url":"https://api.github.com/users/maddin2016/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maddin2016/subscriptions","organizations_url":"https://api.github.com/users/maddin2016/orgs","repos_url":"https://api.github.com/users/maddin2016/repos","events_url":"https://api.github.com/users/maddin2016/events{/privacy}","received_events_url":"https://api.github.com/users/maddin2016/received_events","type":"User","site_admin":false},"body":"fix #899 \r\n\r\nHere is an approach to keep the folder structure for `CopyFiles`. I add some new overloads. Yet only for patterns. \r\n","created_at":"2016-08-10T11:45:27Z","updated_at":"2016-08-22T11:03:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d2cf59c2a48051196e8d9e1d96793641fae7b8fb","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/cake-build/cake/pulls/1145/commits","review_comments_url":"https://api.github.com/repos/cake-build/cake/pulls/1145/comments","review_comment_url":"https://api.github.com/repos/cake-build/cake/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cake-build/cake/issues/1145/comments","statuses_url":"https://api.github.com/repos/cake-build/cake/statuses/da15709e62e289cfa1e8dd67b5a50679984a9c71","head":{"label":"maddin2016:copy-directory-structure","ref":"copy-directory-structure","sha":"da15709e62e289cfa1e8dd67b5a50679984a9c71","user":{"login":"maddin2016","id":19551763,"avatar_url":"https://avatars.githubusercontent.com/u/19551763?v=3","gravatar_id":"","url":"https://api.github.com/users/maddin2016","html_url":"https://github.com/maddin2016","followers_url":"https://api.github.com/users/maddin2016/followers","following_url":"https://api.github.com/users/maddin2016/following{/other_user}","gists_url":"https://api.github.com/users/maddin2016/gists{/gist_id}","starred_url":"https://api.github.com/users/maddin2016/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maddin2016/subscriptions","organizations_url":"https://api.github.com/users/maddin2016/orgs","repos_url":"https://api.github.com/users/maddin2016/repos","events_url":"https://api.github.com/users/maddin2016/events{/privacy}","received_events_url":"https://api.github.com/users/maddin2016/received_events","type":"User","site_admin":false},"repo":{"id":64752582,"name":"cake","full_name":"maddin2016/cake","owner":{"login":"maddin2016","id":19551763,"avatar_url":"https://avatars.githubusercontent.com/u/19551763?v=3","gravatar_id":"","url":"https://api.github.com/users/maddin2016","html_url":"https://github.com/maddin2016","followers_url":"https://api.github.com/users/maddin2016/followers","following_url":"https://api.github.com/users/maddin2016/following{/other_user}","gists_url":"https://api.github.com/users/maddin2016/gists{/gist_id}","starred_url":"https://api.github.com/users/maddin2016/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maddin2016/subscriptions","organizations_url":"https://api.github.com/users/maddin2016/orgs","repos_url":"https://api.github.com/users/maddin2016/repos","events_url":"https://api.github.com/users/maddin2016/events{/privacy}","received_events_url":"https://api.github.com/users/maddin2016/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/maddin2016/cake","description":"Cake (C# Make) is a cross platform build automation system.","fork":true,"url":"https://api.github.com/repos/maddin2016/cake","forks_url":"https://api.github.com/repos/maddin2016/cake/forks","keys_url":"https://api.github.com/repos/maddin2016/cake/keys{/key_id}","collaborators_url":"https://api.github.com/repos/maddin2016/cake/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/maddin2016/cake/teams","hooks_url":"https://api.github.com/repos/maddin2016/cake/hooks","issue_events_url":"https://api.github.com/repos/maddin2016/cake/issues/events{/number}","events_url":"https://api.github.com/repos/maddin2016/cake/events","assignees_url":"https://api.github.com/repos/maddin2016/cake/assignees{/user}","branches_url":"https://api.github.com/repos/maddin2016/cake/branches{/branch}","tags_url":"https://api.github.com/repos/maddin2016/cake/tags","blobs_url":"https://api.github.com/repos/maddin2016/cake/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/maddin2016/cake/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/maddin2016/cake/git/refs{/sha}","trees_url":"https://api.github.com/repos/maddin2016/cake/git/trees{/sha}","statuses_url":"https://api.github.com/repos/maddin2016/cake/statuses/{sha}","languages_url":"https://api.github.com/repos/maddin2016/cake/languages","stargazers_url":"https://api.github.com/repos/maddin2016/cake/stargazers","contributors_url":"https://api.github.com/repos/maddin2016/cake/contributors","subscribers_url":"https://api.github.com/repos/maddin2016/cake/subscribers","subscription_url":"https://api.github.com/repos/maddin2016/cake/subscription","commits_url":"https://api.github.com/repos/maddin2016/cake/commits{/sha}","git_commits_url":"https://api.github.com/repos/maddin2016/cake/git/commits{/sha}","comments_url":"https://api.github.com/repos/maddin2016/cake/comments{/number}","issue_comment_url":"https://api.github.com/repos/maddin2016/cake/issues/comments{/number}","contents_url":"https://api.github.com/repos/maddin2016/cake/contents/{+path}","compare_url":"https://api.github.com/repos/maddin2016/cake/compare/{base}...{head}","merges_url":"https://api.github.com/repos/maddin2016/cake/merges","archive_url":"https://api.github.com/repos/maddin2016/cake/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/maddin2016/cake/downloads","issues_url":"https://api.github.com/repos/maddin2016/cake/issues{/number}","pulls_url":"https://api.github.com/repos/maddin2016/cake/pulls{/number}","milestones_url":"https://api.github.com/repos/maddin2016/cake/milestones{/number}","notifications_url":"https://api.github.com/repos/maddin2016/cake/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/maddin2016/cake/labels{/name}","releases_url":"https://api.github.com/repos/maddin2016/cake/releases{/id}","deployments_url":"https://api.github.com/repos/maddin2016/cake/deployments","created_at":"2016-08-02T11:51:10Z","updated_at":"2016-08-02T11:51:13Z","pushed_at":"2016-08-22T09:18:28Z","git_url":"git://github.com/maddin2016/cake.git","ssh_url":"git@github.com:maddin2016/cake.git","clone_url":"https://github.com/maddin2016/cake.git","svn_url":"https://github.com/maddin2016/cake","homepage":"http://cakebuild.net/","size":6128,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"cake-build:develop","ref":"develop","sha":"649f95b4a5ad34d6fa5a2cef2b1e2d60e76cc18d","user":{"login":"cake-build","id":7738262,"avatar_url":"https://avatars.githubusercontent.com/u/7738262?v=3","gravatar_id":"","url":"https://api.github.com/users/cake-build","html_url":"https://github.com/cake-build","followers_url":"https://api.github.com/users/cake-build/followers","following_url":"https://api.github.com/users/cake-build/following{/other_user}","gists_url":"https://api.github.com/users/cake-build/gists{/gist_id}","starred_url":"https://api.github.com/users/cake-build/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cake-build/subscriptions","organizations_url":"https://api.github.com/users/cake-build/orgs","repos_url":"https://api.github.com/users/cake-build/repos","events_url":"https://api.github.com/users/cake-build/events{/privacy}","received_events_url":"https://api.github.com/users/cake-build/received_events","type":"Organization","site_admin":false},"repo":{"id":20094029,"name":"cake","full_name":"cake-build/cake","owner":{"login":"cake-build","id":7738262,"avatar_url":"https://avatars.githubusercontent.com/u/7738262?v=3","gravatar_id":"","url":"https://api.github.com/users/cake-build","html_url":"https://github.com/cake-build","followers_url":"https://api.github.com/users/cake-build/followers","following_url":"https://api.github.com/users/cake-build/following{/other_user}","gists_url":"https://api.github.com/users/cake-build/gists{/gist_id}","starred_url":"https://api.github.com/users/cake-build/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cake-build/subscriptions","organizations_url":"https://api.github.com/users/cake-build/orgs","repos_url":"https://api.github.com/users/cake-build/repos","events_url":"https://api.github.com/users/cake-build/events{/privacy}","received_events_url":"https://api.github.com/users/cake-build/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cake-build/cake","description":"Cake (C# Make) is a cross platform build automation system.","fork":false,"url":"https://api.github.com/repos/cake-build/cake","forks_url":"https://api.github.com/repos/cake-build/cake/forks","keys_url":"https://api.github.com/repos/cake-build/cake/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cake-build/cake/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cake-build/cake/teams","hooks_url":"https://api.github.com/repos/cake-build/cake/hooks","issue_events_url":"https://api.github.com/repos/cake-build/cake/issues/events{/number}","events_url":"https://api.github.com/repos/cake-build/cake/events","assignees_url":"https://api.github.com/repos/cake-build/cake/assignees{/user}","branches_url":"https://api.github.com/repos/cake-build/cake/branches{/branch}","tags_url":"https://api.github.com/repos/cake-build/cake/tags","blobs_url":"https://api.github.com/repos/cake-build/cake/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cake-build/cake/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cake-build/cake/git/refs{/sha}","trees_url":"https://api.github.com/repos/cake-build/cake/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cake-build/cake/statuses/{sha}","languages_url":"https://api.github.com/repos/cake-build/cake/languages","stargazers_url":"https://api.github.com/repos/cake-build/cake/stargazers","contributors_url":"https://api.github.com/repos/cake-build/cake/contributors","subscribers_url":"https://api.github.com/repos/cake-build/cake/subscribers","subscription_url":"https://api.github.com/repos/cake-build/cake/subscription","commits_url":"https://api.github.com/repos/cake-build/cake/commits{/sha}","git_commits_url":"https://api.github.com/repos/cake-build/cake/git/commits{/sha}","comments_url":"https://api.github.com/repos/cake-build/cake/comments{/number}","issue_comment_url":"https://api.github.com/repos/cake-build/cake/issues/comments{/number}","contents_url":"https://api.github.com/repos/cake-build/cake/contents/{+path}","compare_url":"https://api.github.com/repos/cake-build/cake/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cake-build/cake/merges","archive_url":"https://api.github.com/repos/cake-build/cake/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cake-build/cake/downloads","issues_url":"https://api.github.com/repos/cake-build/cake/issues{/number}","pulls_url":"https://api.github.com/repos/cake-build/cake/pulls{/number}","milestones_url":"https://api.github.com/repos/cake-build/cake/milestones{/number}","notifications_url":"https://api.github.com/repos/cake-build/cake/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cake-build/cake/labels{/name}","releases_url":"https://api.github.com/repos/cake-build/cake/releases{/id}","deployments_url":"https://api.github.com/repos/cake-build/cake/deployments","created_at":"2014-05-23T09:26:54Z","updated_at":"2016-08-22T09:32:43Z","pushed_at":"2016-08-22T09:18:29Z","git_url":"git://github.com/cake-build/cake.git","ssh_url":"git@github.com:cake-build/cake.git","clone_url":"https://github.com/cake-build/cake.git","svn_url":"https://github.com/cake-build/cake","homepage":"http://cakebuild.net/","size":9005,"stargazers_count":744,"watchers_count":744,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":189,"mirror_url":null,"open_issues_count":134,"forks":189,"open_issues":134,"watchers":744,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/cake-build/cake/pulls/1145"},"html":{"href":"https://github.com/cake-build/cake/pull/1145"},"issue":{"href":"https://api.github.com/repos/cake-build/cake/issues/1145"},"comments":{"href":"https://api.github.com/repos/cake-build/cake/issues/1145/comments"},"review_comments":{"href":"https://api.github.com/repos/cake-build/cake/pulls/1145/comments"},"review_comment":{"href":"https://api.github.com/repos/cake-build/cake/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cake-build/cake/pulls/1145/commits"},"statuses":{"href":"https://api.github.com/repos/cake-build/cake/statuses/da15709e62e289cfa1e8dd67b5a50679984a9c71"}}}}
{"actor":{"display_login":"patriksvensson"}}