fix cache directory create ente directory and put cache inside it

This commit is contained in:
Abhinav 2022-08-10 13:14:45 +05:30
parent 7d033bbe19
commit 296797a5ce

View file

@ -2,7 +2,12 @@ import { ipcRenderer } from 'electron/renderer';
import path from 'path'; import path from 'path';
import { readFile, writeFile, existsSync, mkdir } from 'promise-fs'; import { readFile, writeFile, existsSync, mkdir } from 'promise-fs';
const getCacheDir = async () => await ipcRenderer.invoke('get-path', 'cache'); const CACHE_DIR = 'ente';
const getCacheDir = async () => {
const systemCacheDir = await ipcRenderer.invoke('get-path', 'cache');
return path.join(systemCacheDir, CACHE_DIR);
};
export async function openLocalCache(cacheName: string) { export async function openLocalCache(cacheName: string) {
const cacheDir = await getCacheDir(); const cacheDir = await getCacheDir();