{"action":"created","comment":{"url":"https://api.github.com/repos/OptimalBits/dolphin/pulls/comments/177381989","pull_request_review_id":107239176,"id":177381989,"diff_hunk":"@@ -184,6 +184,90 @@ Dolphin.prototype.docker = function(args){\n   });\n }\n \n+/**\n+ * @param {string | Buffer | string[]} str\n+ * @private \n+ */\n+function trimTerminator(str) {","path":"index.js","position":8,"original_position":8,"commit_id":"ff53bdd8ab14b5eacaea10c4b911009624210fd4","original_commit_id":"ff53bdd8ab14b5eacaea10c4b911009624210fd4","user":{"login":"claude-abounegm","id":11809881,"avatar_url":"https://avatars2.githubusercontent.com/u/11809881?v=4","gravatar_id":"","url":"https://api.github.com/users/claude-abounegm","html_url":"https://github.com/claude-abounegm","followers_url":"https://api.github.com/users/claude-abounegm/followers","following_url":"https://api.github.com/users/claude-abounegm/following{/other_user}","gists_url":"https://api.github.com/users/claude-abounegm/gists{/gist_id}","starred_url":"https://api.github.com/users/claude-abounegm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/claude-abounegm/subscriptions","organizations_url":"https://api.github.com/users/claude-abounegm/orgs","repos_url":"https://api.github.com/users/claude-abounegm/repos","events_url":"https://api.github.com/users/claude-abounegm/events{/privacy}","received_events_url":"https://api.github.com/users/claude-abounegm/received_events","type":"User","site_admin":false},"body":"I was using `String.prototype.trim()` before changing to my own custom method. The reason for using the custom method is, let's say a dev has their own custom script in their Docker container. That script, when called, echoes:\r\n```\r\n      Status: Hello World   \\n\r\n```\r\n(Notice the 6 leading spaces). I think the white-space should be kept, as those spaces were intended to be there. I do not see why someone would do that though, but it is a rare possibility that I think should be taken in account. The use of `trim()` would had returned `Status: Hello World`; albeit, cleaner, but different than expected output. If the dev wants to clean the string, they could call `trim` themselves. We just get rid of the line feeds, which are pretty annoying.\r\n\r\nLet me know what you think!","created_at":"2018-03-27T10:47:42Z","updated_at":"2018-03-27T10:47:42Z","html_url":"https://github.com/OptimalBits/dolphin/pull/4#discussion_r177381989","pull_request_url":"https://api.github.com/repos/OptimalBits/dolphin/pulls/4","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/OptimalBits/dolphin/pulls/comments/177381989"},"html":{"href":"https://github.com/OptimalBits/dolphin/pull/4#discussion_r177381989"},"pull_request":{"href":"https://api.github.com/repos/OptimalBits/dolphin/pulls/4"}},"in_reply_to_id":177362080},"pull_request":{"url":"https://api.github.com/repos/OptimalBits/dolphin/pulls/4","id":177589884,"html_url":"https://github.com/OptimalBits/dolphin/pull/4","diff_url":"https://github.com/OptimalBits/dolphin/pull/4.diff","patch_url":"https://github.com/OptimalBits/dolphin/pull/4.patch","issue_url":"https://api.github.com/repos/OptimalBits/dolphin/issues/4","number":4,"state":"open","locked":false,"title":"Added dolphin.cmd() a variation of dolphin.docker()","user":{"login":"claude-abounegm","id":11809881,"avatar_url":"https://avatars2.githubusercontent.com/u/11809881?v=4","gravatar_id":"","url":"https://api.github.com/users/claude-abounegm","html_url":"https://github.com/claude-abounegm","followers_url":"https://api.github.com/users/claude-abounegm/followers","following_url":"https://api.github.com/users/claude-abounegm/following{/other_user}","gists_url":"https://api.github.com/users/claude-abounegm/gists{/gist_id}","starred_url":"https://api.github.com/users/claude-abounegm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/claude-abounegm/subscriptions","organizations_url":"https://api.github.com/users/claude-abounegm/orgs","repos_url":"https://api.github.com/users/claude-abounegm/repos","events_url":"https://api.github.com/users/claude-abounegm/events{/privacy}","received_events_url":"https://api.github.com/users/claude-abounegm/received_events","type":"User","site_admin":false},"body":"The point of this new addition is to not lose information when executing a docker command.\r\n\r\n- Not modifying `docker(args)` function to be backward compatible.\r\n- `cmd()` has the signature:\r\n```ts\r\ninterface DockerCommandResult {\r\n    readonly stdout: string;\r\n    readonly stderr: string;\r\n}\r\n\r\nfunction cmd(args: string[], cb?: (data: string, err: string) => void) => Promise<DockerCommandResult>;\r\n```\r\n- When a callback function is given, the function is called on every new string received from `stdout` or `stderr`. If an error is in place, the callback is called with `cb(null, err)`. Otherwise, `cb(data)`.\r\n- If a non-zero code is returned, an `Error` is thrown, with four extra fields: `code, signal, stdout, and stderr`. This follows, more or less this signature:\r\n```ts\r\ninterface DockerError extends Error implements DockerCommandResult {\r\n    readonly code: number;\r\n    readonly signal: string;\r\n\r\n    readonly stdout: string;\r\n    readonly stderr: string;\r\n}\r\n```\r\n\r\nFiles that were using `dolphin.docker()` were changed to use `dolphin.cmd()`.\r\n\r\nAlso, fixed `dolphin.images.build()` to not need `versions` or `params`","created_at":"2018-03-26T22:57:17Z","updated_at":"2018-03-27T10:47:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e8ce45cc9a21f7486c51bfd727df164a8b86f1ca","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/OptimalBits/dolphin/pulls/4/commits","review_comments_url":"https://api.github.com/repos/OptimalBits/dolphin/pulls/4/comments","review_comment_url":"https://api.github.com/repos/OptimalBits/dolphin/pulls/comments{/number}","comments_url":"https://api.github.com/repos/OptimalBits/dolphin/issues/4/comments","statuses_url":"https://api.github.com/repos/OptimalBits/dolphin/statuses/ff53bdd8ab14b5eacaea10c4b911009624210fd4","head":{"label":"claude-abounegm:master","ref":"master","sha":"ff53bdd8ab14b5eacaea10c4b911009624210fd4","user":{"login":"claude-abounegm","id":11809881,"avatar_url":"https://avatars2.githubusercontent.com/u/11809881?v=4","gravatar_id":"","url":"https://api.github.com/users/claude-abounegm","html_url":"https://github.com/claude-abounegm","followers_url":"https://api.github.com/users/claude-abounegm/followers","following_url":"https://api.github.com/users/claude-abounegm/following{/other_user}","gists_url":"https://api.github.com/users/claude-abounegm/gists{/gist_id}","starred_url":"https://api.github.com/users/claude-abounegm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/claude-abounegm/subscriptions","organizations_url":"https://api.github.com/users/claude-abounegm/orgs","repos_url":"https://api.github.com/users/claude-abounegm/repos","events_url":"https://api.github.com/users/claude-abounegm/events{/privacy}","received_events_url":"https://api.github.com/users/claude-abounegm/received_events","type":"User","site_admin":false},"repo":{"id":126891066,"name":"dolphin","full_name":"claude-abounegm/dolphin","owner":{"login":"claude-abounegm","id":11809881,"avatar_url":"https://avatars2.githubusercontent.com/u/11809881?v=4","gravatar_id":"","url":"https://api.github.com/users/claude-abounegm","html_url":"https://github.com/claude-abounegm","followers_url":"https://api.github.com/users/claude-abounegm/followers","following_url":"https://api.github.com/users/claude-abounegm/following{/other_user}","gists_url":"https://api.github.com/users/claude-abounegm/gists{/gist_id}","starred_url":"https://api.github.com/users/claude-abounegm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/claude-abounegm/subscriptions","organizations_url":"https://api.github.com/users/claude-abounegm/orgs","repos_url":"https://api.github.com/users/claude-abounegm/repos","events_url":"https://api.github.com/users/claude-abounegm/events{/privacy}","received_events_url":"https://api.github.com/users/claude-abounegm/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/claude-abounegm/dolphin","description":"A fast, lightweight an modular library to interact with docker daemons.","fork":true,"url":"https://api.github.com/repos/claude-abounegm/dolphin","forks_url":"https://api.github.com/repos/claude-abounegm/dolphin/forks","keys_url":"https://api.github.com/repos/claude-abounegm/dolphin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/claude-abounegm/dolphin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/claude-abounegm/dolphin/teams","hooks_url":"https://api.github.com/repos/claude-abounegm/dolphin/hooks","issue_events_url":"https://api.github.com/repos/claude-abounegm/dolphin/issues/events{/number}","events_url":"https://api.github.com/repos/claude-abounegm/dolphin/events","assignees_url":"https://api.github.com/repos/claude-abounegm/dolphin/assignees{/user}","branches_url":"https://api.github.com/repos/claude-abounegm/dolphin/branches{/branch}","tags_url":"https://api.github.com/repos/claude-abounegm/dolphin/tags","blobs_url":"https://api.github.com/repos/claude-abounegm/dolphin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/claude-abounegm/dolphin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/claude-abounegm/dolphin/git/refs{/sha}","trees_url":"https://api.github.com/repos/claude-abounegm/dolphin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/claude-abounegm/dolphin/statuses/{sha}","languages_url":"https://api.github.com/repos/claude-abounegm/dolphin/languages","stargazers_url":"https://api.github.com/repos/claude-abounegm/dolphin/stargazers","contributors_url":"https://api.github.com/repos/claude-abounegm/dolphin/contributors","subscribers_url":"https://api.github.com/repos/claude-abounegm/dolphin/subscribers","subscription_url":"https://api.github.com/repos/claude-abounegm/dolphin/subscription","commits_url":"https://api.github.com/repos/claude-abounegm/dolphin/commits{/sha}","git_commits_url":"https://api.github.com/repos/claude-abounegm/dolphin/git/commits{/sha}","comments_url":"https://api.github.com/repos/claude-abounegm/dolphin/comments{/number}","issue_comment_url":"https://api.github.com/repos/claude-abounegm/dolphin/issues/comments{/number}","contents_url":"https://api.github.com/repos/claude-abounegm/dolphin/contents/{+path}","compare_url":"https://api.github.com/repos/claude-abounegm/dolphin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/claude-abounegm/dolphin/merges","archive_url":"https://api.github.com/repos/claude-abounegm/dolphin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/claude-abounegm/dolphin/downloads","issues_url":"https://api.github.com/repos/claude-abounegm/dolphin/issues{/number}","pulls_url":"https://api.github.com/repos/claude-abounegm/dolphin/pulls{/number}","milestones_url":"https://api.github.com/repos/claude-abounegm/dolphin/milestones{/number}","notifications_url":"https://api.github.com/repos/claude-abounegm/dolphin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/claude-abounegm/dolphin/labels{/name}","releases_url":"https://api.github.com/repos/claude-abounegm/dolphin/releases{/id}","deployments_url":"https://api.github.com/repos/claude-abounegm/dolphin/deployments","created_at":"2018-03-26T21:17:29Z","updated_at":"2018-03-27T01:02:20Z","pushed_at":"2018-03-27T01:02:18Z","git_url":"git://github.com/claude-abounegm/dolphin.git","ssh_url":"git@github.com:claude-abounegm/dolphin.git","clone_url":"https://github.com/claude-abounegm/dolphin.git","svn_url":"https://github.com/claude-abounegm/dolphin","homepage":"","size":38,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","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":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"OptimalBits:master","ref":"master","sha":"cd794dbad851c2d12b2ea33fba042708e160ea99","user":{"login":"OptimalBits","id":945399,"avatar_url":"https://avatars1.githubusercontent.com/u/945399?v=4","gravatar_id":"","url":"https://api.github.com/users/OptimalBits","html_url":"https://github.com/OptimalBits","followers_url":"https://api.github.com/users/OptimalBits/followers","following_url":"https://api.github.com/users/OptimalBits/following{/other_user}","gists_url":"https://api.github.com/users/OptimalBits/gists{/gist_id}","starred_url":"https://api.github.com/users/OptimalBits/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OptimalBits/subscriptions","organizations_url":"https://api.github.com/users/OptimalBits/orgs","repos_url":"https://api.github.com/users/OptimalBits/repos","events_url":"https://api.github.com/users/OptimalBits/events{/privacy}","received_events_url":"https://api.github.com/users/OptimalBits/received_events","type":"Organization","site_admin":false},"repo":{"id":34165287,"name":"dolphin","full_name":"OptimalBits/dolphin","owner":{"login":"OptimalBits","id":945399,"avatar_url":"https://avatars1.githubusercontent.com/u/945399?v=4","gravatar_id":"","url":"https://api.github.com/users/OptimalBits","html_url":"https://github.com/OptimalBits","followers_url":"https://api.github.com/users/OptimalBits/followers","following_url":"https://api.github.com/users/OptimalBits/following{/other_user}","gists_url":"https://api.github.com/users/OptimalBits/gists{/gist_id}","starred_url":"https://api.github.com/users/OptimalBits/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OptimalBits/subscriptions","organizations_url":"https://api.github.com/users/OptimalBits/orgs","repos_url":"https://api.github.com/users/OptimalBits/repos","events_url":"https://api.github.com/users/OptimalBits/events{/privacy}","received_events_url":"https://api.github.com/users/OptimalBits/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/OptimalBits/dolphin","description":"A fast, lightweight an modular library to interact with docker daemons.","fork":false,"url":"https://api.github.com/repos/OptimalBits/dolphin","forks_url":"https://api.github.com/repos/OptimalBits/dolphin/forks","keys_url":"https://api.github.com/repos/OptimalBits/dolphin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/OptimalBits/dolphin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/OptimalBits/dolphin/teams","hooks_url":"https://api.github.com/repos/OptimalBits/dolphin/hooks","issue_events_url":"https://api.github.com/repos/OptimalBits/dolphin/issues/events{/number}","events_url":"https://api.github.com/repos/OptimalBits/dolphin/events","assignees_url":"https://api.github.com/repos/OptimalBits/dolphin/assignees{/user}","branches_url":"https://api.github.com/repos/OptimalBits/dolphin/branches{/branch}","tags_url":"https://api.github.com/repos/OptimalBits/dolphin/tags","blobs_url":"https://api.github.com/repos/OptimalBits/dolphin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/OptimalBits/dolphin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/OptimalBits/dolphin/git/refs{/sha}","trees_url":"https://api.github.com/repos/OptimalBits/dolphin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/OptimalBits/dolphin/statuses/{sha}","languages_url":"https://api.github.com/repos/OptimalBits/dolphin/languages","stargazers_url":"https://api.github.com/repos/OptimalBits/dolphin/stargazers","contributors_url":"https://api.github.com/repos/OptimalBits/dolphin/contributors","subscribers_url":"https://api.github.com/repos/OptimalBits/dolphin/subscribers","subscription_url":"https://api.github.com/repos/OptimalBits/dolphin/subscription","commits_url":"https://api.github.com/repos/OptimalBits/dolphin/commits{/sha}","git_commits_url":"https://api.github.com/repos/OptimalBits/dolphin/git/commits{/sha}","comments_url":"https://api.github.com/repos/OptimalBits/dolphin/comments{/number}","issue_comment_url":"https://api.github.com/repos/OptimalBits/dolphin/issues/comments{/number}","contents_url":"https://api.github.com/repos/OptimalBits/dolphin/contents/{+path}","compare_url":"https://api.github.com/repos/OptimalBits/dolphin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/OptimalBits/dolphin/merges","archive_url":"https://api.github.com/repos/OptimalBits/dolphin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/OptimalBits/dolphin/downloads","issues_url":"https://api.github.com/repos/OptimalBits/dolphin/issues{/number}","pulls_url":"https://api.github.com/repos/OptimalBits/dolphin/pulls{/number}","milestones_url":"https://api.github.com/repos/OptimalBits/dolphin/milestones{/number}","notifications_url":"https://api.github.com/repos/OptimalBits/dolphin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/OptimalBits/dolphin/labels{/name}","releases_url":"https://api.github.com/repos/OptimalBits/dolphin/releases{/id}","deployments_url":"https://api.github.com/repos/OptimalBits/dolphin/deployments","created_at":"2015-04-18T12:37:22Z","updated_at":"2017-11-08T18:09:44Z","pushed_at":"2018-03-27T01:02:20Z","git_url":"git://github.com/OptimalBits/dolphin.git","ssh_url":"git@github.com:OptimalBits/dolphin.git","clone_url":"https://github.com/OptimalBits/dolphin.git","svn_url":"https://github.com/OptimalBits/dolphin","homepage":"","size":35,"stargazers_count":14,"watchers_count":14,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"archived":false,"open_issues_count":2,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":7,"open_issues":2,"watchers":14,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/OptimalBits/dolphin/pulls/4"},"html":{"href":"https://github.com/OptimalBits/dolphin/pull/4"},"issue":{"href":"https://api.github.com/repos/OptimalBits/dolphin/issues/4"},"comments":{"href":"https://api.github.com/repos/OptimalBits/dolphin/issues/4/comments"},"review_comments":{"href":"https://api.github.com/repos/OptimalBits/dolphin/pulls/4/comments"},"review_comment":{"href":"https://api.github.com/repos/OptimalBits/dolphin/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/OptimalBits/dolphin/pulls/4/commits"},"statuses":{"href":"https://api.github.com/repos/OptimalBits/dolphin/statuses/ff53bdd8ab14b5eacaea10c4b911009624210fd4"}},"author_association":"NONE"}}
{"actor":{"display_login":"claude-abounegm"}}