move doesFolderExists to common api
This commit is contained in:
parent
8fe23a4da1
commit
64acef79d3
|
@ -1,4 +1,5 @@
|
|||
import { ipcRenderer } from 'electron';
|
||||
import fs from 'promise-fs';
|
||||
|
||||
export const sendNotification = (content: string) => {
|
||||
ipcRenderer.send('send-notification', content);
|
||||
|
@ -9,3 +10,12 @@ export const showOnTray = (content: string) => {
|
|||
export const reloadWindow = () => {
|
||||
ipcRenderer.send('reload-window');
|
||||
};
|
||||
|
||||
export async function doesFolderExists(dirPath: string) {
|
||||
return await fs
|
||||
.stat(dirPath)
|
||||
.then((stats) => {
|
||||
return stats.isDirectory();
|
||||
})
|
||||
.catch(() => false);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue