From 998218e5545b98fe5923ec915e49a3d03f2fb209 Mon Sep 17 00:00:00 2001 From: Jason Antwi-Appah Date: Sat, 16 Jan 2021 19:35:15 +0000 Subject: [PATCH] feat(macOS): add support for user-only Notion installs --- pkg/helpers.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkg/helpers.js b/pkg/helpers.js index 03133b7..09f635f 100644 --- a/pkg/helpers.js +++ b/pkg/helpers.js @@ -57,7 +57,12 @@ function getNotionResources() { let folder = ''; switch (process.platform) { case 'darwin': - folder = '/Applications/Notion.app/Contents/Resources'; + for (let loc of [ + `/Users/${process.env.USER}/Applications/Notion.app/Contents/Resources`, // Notion is installed only for the current user + '/Applications/Notion.app/Contents/Resources' // Notion is installed globally + ]) { + if (fs.pathExistsSync(loc)) folder = loc; + } break; case 'win32': folder = process.env.LOCALAPPDATA + '\\Programs\\Notion\\resources';