From a88d4a488f91be2a0e5f799a90109b41f639139a Mon Sep 17 00:00:00 2001
From: Jonathan Wilkes <jon.w.wilkes@gmail.com>
Date: Wed, 18 Oct 2017 23:40:45 -0400
Subject: [PATCH] fix #380: regression: the arg parser in the nwjs "open" event
 callback got broken

This was a consequence of implementing the "-unique" flag. It
required adding a "data-dir" flag to the command line which
through off the _very_ brittle arg parser in the "open" event
callback.
---
 pd/nw/index.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pd/nw/index.js b/pd/nw/index.js
index ade8c1850..b852054c0 100644
--- a/pd/nw/index.js
+++ b/pd/nw/index.js
@@ -313,7 +313,7 @@ function add_events() {
                 argv_string = argv_string.slice(0, -pd_engine_id.length).trim();
                 // strip off the gui dir
                 argv_string = argv_string.slice(0,
-                    -nw.App.argv[3].length).trim();
+                    -nw.App.argv[4].length).trim();
                 if (process.platform === "win32") {
                     // windows quotes this string, so let's remove the two
                     // quotation marks
-- 
GitLab