jamesgpearce / confess

[ARCHIVED] Uses PhantomJS to headlessly analyze web pages and generate manifests. You may be able to use the puppeteer-har package instead.
874 stars 101 forks source link

TypeError: undefined is not an object (evaluating 'phantom.args.length') #15

Open hotbaby opened 7 years ago

hotbaby commented 7 years ago
diff --git a/confess.js b/confess.js
index 6164d55..99ea04d 100644
--- a/confess.js
+++ b/confess.js
@@ -1,3 +1,4 @@
+var system = require('system');
 var fs = require('fs');
 var confess = {

@@ -411,11 +412,11 @@ var confess = {
     },

     processArgs: function (config, contract) {
-        var a = 0;
+        var a = 1;
         var ok = true;
         contract.forEach(function(argument) {
-            if (a < phantom.args.length) {
-                config[argument.name] = phantom.args[a];
+            if (a < system.args.length) {
+                config[argument.name] = system.args[a];
             } else {
                 if (argument.req) {
                     console.log('"' + argument.name + '" argument is required. This ' + argument.desc + '.');