Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

add option for silent copy #7

Closed
wants to merge 1 commit into from

2 participants

@Sinetheta

That console.log can be disruptive. I thought "settings" would be a little bit of overkill, so maybe just a flag?

@xavi-
Owner

Seems like a good idea. But I think it'd be more natural to add a function call similar to noConflict called silent. I'll commit the change shortly.

@xavi- xavi- referenced this pull request from a commit
@xavi- Document silent function in README. #7 3aec200
@xavi-
Owner

Alright, added the silent function. Let me know if everything looks good to you.

Thanks.

@xavi- xavi- closed this
@Sinetheta

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 24, 2014
  1. @Sinetheta

    add option for silent copy

    Sinetheta authored
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 2 deletions.
  1. +2 −2 index.js
View
4 index.js
@@ -27,14 +27,14 @@ switch(process.platform) {
var _copy = GLOBAL.copy, _paste = GLOBAL.paste;
-var copy = GLOBAL.copy = exports.copy = function(text, cb) {
+var copy = GLOBAL.copy = exports.copy = function(text, cb, silent) {
var child = spawn(config.copy.command, config.copy.args);
var err = [];
child
.on("exit", function() {
if(cb) { cb(null, text); }
- else { console.log("Copy complete"); }
+ else if(!silent){ console.log("Copy complete"); }
})
.on("error", function(err) { cb(err); })
.stderr
Something went wrong with that request. Please try again.