mirror of
https://github.com/neosubhamoy/neodlp.git
synced 2026-03-22 22:55:48 +05:30
fix: debug linux registration failing on flatpak
This commit is contained in:
@@ -3,6 +3,7 @@ import * as fs from "@tauri-apps/plugin-fs";
|
||||
import { useKvPairs } from "@/helpers/use-kvpairs";
|
||||
import { useSettingsPageStatesStore } from "@/services/store";
|
||||
import { invoke } from "@tauri-apps/api/core";
|
||||
import { useLogger } from "@/helpers/use-logger";
|
||||
|
||||
interface FileMap {
|
||||
source: string;
|
||||
@@ -12,6 +13,7 @@ interface FileMap {
|
||||
|
||||
export function useLinuxRegisterer() {
|
||||
const { saveKvPair } = useKvPairs();
|
||||
const LOG = useLogger();
|
||||
const appVersion = useSettingsPageStatesStore(state => state.appVersion);
|
||||
|
||||
const registerToLinux = async () => {
|
||||
@@ -27,6 +29,8 @@ export function useLinuxRegisterer() {
|
||||
const homeDirPath = await homeDir();
|
||||
const configDirPath = await configDir();
|
||||
|
||||
LOG.info("LINUX REGISTERER", `Starting registration process. isFlatpak: ${isFlatpak}, resourceDirPath: ${resourceDirPath}, homeDirPath: ${homeDirPath}, configDirPath: ${configDirPath}`);
|
||||
|
||||
for (const file of filesToCopy) {
|
||||
const sourcePath = await join(resourceDirPath, file.source);
|
||||
const destinationDir = isFlatpak ? await join(configDirPath, file.dir) : await join(homeDirPath, file.dir);
|
||||
@@ -47,6 +51,7 @@ export function useLinuxRegisterer() {
|
||||
return { success: true, message: 'Registered successfully' }
|
||||
} catch (error) {
|
||||
console.error('Error copying files:', error);
|
||||
LOG.error("LINUX REGISTERER", `Error during registration: ${error}`);
|
||||
return { success: false, message: 'Failed to register' }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user