1
1
mirror of https://github.com/neosubhamoy/neodlp.git synced 2026-03-22 19:25:49 +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) {
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) {