[Pkg-javascript-commits] [node-ncp] 01/02: Revert "remove binary"
Andrew Kelley
andrewrk-guest at moszumanska.debian.org
Tue Jul 1 18:25:26 UTC 2014
This is an automated email from the git hooks/post-receive script.
andrewrk-guest pushed a commit to branch master
in repository node-ncp.
commit 0065a6c74c7bf84e9fbe92961dd84b4083ee7bb6
Author: Andrew Kelley <superjoe30 at gmail.com>
Date: Tue Jul 1 18:23:17 2014 +0000
Revert "remove binary"
This reverts commit 213b650ce08705d4946c0c1b92a7096e8bce961a.
---
bin/ncp | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
debian/dirs | 1 +
debian/install | 1 +
debian/links | 1 +
4 files changed, 51 insertions(+)
diff --git a/bin/ncp b/bin/ncp
new file mode 100755
index 0000000..388eaba
--- /dev/null
+++ b/bin/ncp
@@ -0,0 +1,48 @@
+#!/usr/bin/env node
+
+
+
+
+var ncp = require('../lib/ncp'),
+ args = process.argv.slice(2),
+ source, dest;
+
+if (args.length < 2) {
+ console.error('Usage: ncp [source] [destination] [--filter=filter] [--limit=concurrency limit]');
+ process.exit(1);
+}
+
+// parse arguments the hard way
+function startsWith(str, prefix) {
+ return str.substr(0, prefix.length) == prefix;
+}
+
+var options = {};
+args.forEach(function (arg) {
+ if (startsWith(arg, "--limit=")) {
+ options.limit = parseInt(arg.split('=', 2)[1], 10);
+ }
+ if (startsWith(arg, "--filter=")) {
+ options.filter = new RegExp(arg.split('=', 2)[1]);
+ }
+ if (startsWith(arg, "--stoponerr")) {
+ options.stopOnErr = true;
+ }
+});
+
+ncp.ncp(args[0], args[1], options, function (err) {
+ if (Array.isArray(err)) {
+ console.error('There were errors during the copy.');
+ err.forEach(function (err) {
+ console.error(err.stack || err.message);
+ });
+ process.exit(1);
+ }
+ else if (err) {
+ console.error('An error has occurred.');
+ console.error(err.stack || err.message);
+ process.exit(1);
+ }
+});
+
+
diff --git a/debian/dirs b/debian/dirs
new file mode 100644
index 0000000..e772481
--- /dev/null
+++ b/debian/dirs
@@ -0,0 +1 @@
+usr/bin
diff --git a/debian/install b/debian/install
index b944d87..7ef6d70 100644
--- a/debian/install
+++ b/debian/install
@@ -1,2 +1,3 @@
package.json usr/lib/nodejs/ncp/
+bin usr/lib/nodejs/ncp/
lib usr/lib/nodejs/ncp/
diff --git a/debian/links b/debian/links
new file mode 100644
index 0000000..e548069
--- /dev/null
+++ b/debian/links
@@ -0,0 +1 @@
+usr/lib/nodejs/ncp/bin/ncp usr/bin/ncp
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-ncp.git
More information about the Pkg-javascript-commits
mailing list