From 705e819fe724b2295a1e8fb622173e90ccc1176a Mon Sep 17 00:00:00 2001 From: Subhamoy Biswas Date: Thu, 26 Feb 2026 09:48:29 +0530 Subject: [PATCH] refactor: don't check for dir, directly copy on flatpak registration --- src/helpers/use-linux-registerer.ts | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/helpers/use-linux-registerer.ts b/src/helpers/use-linux-registerer.ts index 6a3f7a4..135b4b0 100644 --- a/src/helpers/use-linux-registerer.ts +++ b/src/helpers/use-linux-registerer.ts @@ -39,22 +39,22 @@ export function useLinuxRegisterer() { if (isFlatpak) { for (const file of filesToCopyFlatpak) { const sourcePath = await join(resourceDirPath, file.source); - const destinationDir = await join(homeDirPath, file.dir); + // const destinationDir = await join(homeDirPath, file.dir); const destinationPath = await join(homeDirPath, file.destination); - const dirExists = await fs.exists(destinationDir); - if (dirExists) { + // const dirExists = await fs.exists(destinationDir); + // if (dirExists) { await fs.copyFile(sourcePath, destinationPath); console.log(`File ${file.source} copied successfully to ${destinationPath}`); LOG.info("LINUX REGISTERER", `File ${file.source} copied successfully to ${destinationPath}`); - } else { - await fs.mkdir(destinationDir, { recursive: true }) - console.log(`Created dir ${destinationDir}`); - LOG.info("LINUX REGISTERER", `Created dir ${destinationDir}`); - await fs.copyFile(sourcePath, destinationPath); - console.log(`File ${file.source} copied successfully to ${destinationPath}`); - LOG.info("LINUX REGISTERER", `File ${file.source} copied successfully to ${destinationPath}`); - } + // } else { + // await fs.mkdir(destinationDir, { recursive: true }) + // console.log(`Created dir ${destinationDir}`); + // LOG.info("LINUX REGISTERER", `Created dir ${destinationDir}`); + // await fs.copyFile(sourcePath, destinationPath); + // console.log(`File ${file.source} copied successfully to ${destinationPath}`); + // LOG.info("LINUX REGISTERER", `File ${file.source} copied successfully to ${destinationPath}`); + // } } } else { for (const file of filesToCopy) {