From 7b3b0c6358e3dd808e1a6e487926ea8a20c8664d Mon Sep 17 00:00:00 2001 From: Billy Olsen Date: Mon, 4 Nov 2024 17:09:29 -0700 Subject: [PATCH] fix: Move screen recordings to snap user common Snaps do not have access to hidden folders inside the user's home directory, which causes the --record flag to result in a permission denied error. This moves the location of the screen recordings to the $SNAP_USER_COMMON directory (~/snap/ght/common/recordings) which the snap does have access to. Signed-off-by: Billy Olsen --- src/utils/screenRecorder.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/screenRecorder.ts b/src/utils/screenRecorder.ts index 42eed60..0c80229 100644 --- a/src/utils/screenRecorder.ts +++ b/src/utils/screenRecorder.ts @@ -26,8 +26,8 @@ export class ScreenRecorder { } // define output directory for recording file - const homeDir = process.env.SNAP_REAL_HOME || os.homedir(); - const directory = join(homeDir, ".ght", "recordings"); + const homeDir = process.env.SNAP_USER_COMMON || join(os.homedir(), ".ght"); + const directory = join(homeDir, "recordings"); if (!existsSync(directory)) { mkdirSync(directory, { recursive: true }); }