Skip to content
This repository
Browse code

[bin] Exposed --stoponerr option via CLI.

  • Loading branch information...
commit 296f1b132569385d89d4104fba762891edbba187 1 parent 4dbff81
Charlie McConnell authored

Showing 1 changed file with 5 additions and 2 deletions. Show diff stats Hide diff stats

  1. 7  bin/ncp
7  bin/ncp
@@ -20,13 +20,16 @@ function startsWith(str, prefix) {
20 20
 var options = {};
21 21
 args.forEach(function (arg) {
22 22
   if (startsWith(arg, "--limit=")) {
23  
-    ncp.limit = Number(arg.split('=', 2)[1]);
  23
+    options.limit = parseInt(arg.split('=', 2)[1], 10);
24 24
   }
25 25
   if (startsWith(arg, "--filter=")) {
26 26
     options.filter = new RegExp(arg.split('=', 2)[1]);
27 27
   }
  28
+  if (startsWith(arg, "--stoponerr")) {
  29
+    options.stopOnErr = true;
  30
+  }
28 31
 });
29  
-options.stopOnError = true;
  32
+
30 33
 ncp.ncp(args[0], args[1], options, function (err) {
31 34
   if (Array.isArray(err)) {
32 35
     console.error('There were errors during the copy.');

0 notes on commit 296f1b1

Please sign in to comment.
Something went wrong with that request. Please try again.