From 2ae7d13a648d88824932c5bb910637e9536617a3 Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Fri, 19 Mar 2021 07:29:23 -0700 Subject: [PATCH] Strip application path from stack traces Summary: Stacktraces right now always contain the `/home/$USER/.cache/flipper-launcher/v1.2.3/...` (or equivalent) which makes deduping and reading harder. This strips the paths. Reviewed By: mweststrate Differential Revision: D27130251 fbshipit-source-id: c0e8d5eb1575c6269d49a6aee0e8a5e93996d223 --- desktop/app/src/utils/pathUtils.tsx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/desktop/app/src/utils/pathUtils.tsx b/desktop/app/src/utils/pathUtils.tsx index 31c2e04d5..ea5a9aad9 100644 --- a/desktop/app/src/utils/pathUtils.tsx +++ b/desktop/app/src/utils/pathUtils.tsx @@ -31,6 +31,15 @@ export function getStaticPath() { return _staticPath; } +let _appPath: string | undefined = undefined; +export function getAppPath() { + if (!_appPath) { + _appPath = path.join(getStaticPath(), '..'); + } + + return _appPath; +} + export function getChangelogPath() { const staticPath = getStaticPath(); let changelogPath = '';