From c64219f77adfa7c73ff20a3f0cdea5ee4f84aac3 Mon Sep 17 00:00:00 2001 From: Jeff Bargmann Date: Sat, 11 Nov 2017 08:57:58 -0800 Subject: [PATCH] Fix Electron-app root path detection (#34) * Fix Electron-app root path detection * Cleanup --- src/index.coffee | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/index.coffee b/src/index.coffee index 3170fbe..c4f31f2 100644 --- a/src/index.coffee +++ b/src/index.coffee @@ -69,7 +69,9 @@ module.exports = class AutoLaunch # Does not match when the three are different # Also matches when the path is pointing not to the exectuable in the inner app at all but to the Electron # executable in the outer app - return path.replace /(^.+?[^\/]+?\.app)\/Contents\/(Frameworks\/((\1|[^\/]+?) Helper)\.app\/Contents\/MacOS\/\3|MacOS\/Electron)/, '$1' + path = path.replace /(^.+?[^\/]+?\.app)\/Contents\/(Frameworks\/((\1|[^\/]+?) Helper)\.app\/Contents\/MacOS\/\3|MacOS\/Electron)/, '$1' + path = path.replace /\.app\/Contents\/MacOS\/[^\/]*$/, '.app' + return path fixOpts: =>