1
1
mirror of https://github.com/neosubhamoy/neodlp.git synced 2026-03-22 06:55:51 +05:30

refactor: don't check for dir, directly copy on flatpak registration

This commit is contained in:
2026-02-26 09:48:29 +05:30
Verified
parent 137479acbb
commit 705e819fe7

View File

@@ -39,22 +39,22 @@ export function useLinuxRegisterer() {
if (isFlatpak) { if (isFlatpak) {
for (const file of filesToCopyFlatpak) { for (const file of filesToCopyFlatpak) {
const sourcePath = await join(resourceDirPath, file.source); 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 destinationPath = await join(homeDirPath, file.destination);
const dirExists = await fs.exists(destinationDir); // const dirExists = await fs.exists(destinationDir);
if (dirExists) { // if (dirExists) {
await fs.copyFile(sourcePath, destinationPath); await fs.copyFile(sourcePath, destinationPath);
console.log(`File ${file.source} copied successfully to ${destinationPath}`); console.log(`File ${file.source} copied successfully to ${destinationPath}`);
LOG.info("LINUX REGISTERER", `File ${file.source} copied successfully to ${destinationPath}`); LOG.info("LINUX REGISTERER", `File ${file.source} copied successfully to ${destinationPath}`);
} else { // } else {
await fs.mkdir(destinationDir, { recursive: true }) // await fs.mkdir(destinationDir, { recursive: true })
console.log(`Created dir ${destinationDir}`); // console.log(`Created dir ${destinationDir}`);
LOG.info("LINUX REGISTERER", `Created dir ${destinationDir}`); // LOG.info("LINUX REGISTERER", `Created dir ${destinationDir}`);
await fs.copyFile(sourcePath, destinationPath); // await fs.copyFile(sourcePath, destinationPath);
console.log(`File ${file.source} copied successfully to ${destinationPath}`); // console.log(`File ${file.source} copied successfully to ${destinationPath}`);
LOG.info("LINUX REGISTERER", `File ${file.source} copied successfully to ${destinationPath}`); // LOG.info("LINUX REGISTERER", `File ${file.source} copied successfully to ${destinationPath}`);
} // }
} }
} else { } else {
for (const file of filesToCopy) { for (const file of filesToCopy) {