Start giving it more power
This commit is contained in:
parent
e268b9204e
commit
38db03c3a0
1 changed files with 13 additions and 1 deletions
|
@ -1,3 +1,11 @@
|
|||
/**
|
||||
* @file Native filesystem access using custom Node.js functionality provided by
|
||||
* our desktop app.
|
||||
*
|
||||
* Precondition: Unless mentioned otherwise, the functions in these file only
|
||||
* work when we are running in our desktop app.
|
||||
*/
|
||||
|
||||
import { ensureElectron } from "@/next/electron";
|
||||
import { nameAndExtension } from "@/next/file";
|
||||
import sanitize from "sanitize-filename";
|
||||
|
@ -69,4 +77,8 @@ export const safeFileName = async (directoryPath: string, name: string) => {
|
|||
return result;
|
||||
};
|
||||
|
||||
const exists = (path: string) => ensureElectron().fs.exists(path);
|
||||
/**
|
||||
* Return true if an item exists an the given {@link path} on the user's local
|
||||
* filesystem.
|
||||
*/
|
||||
export const exists = (path: string) => ensureElectron().fs.exists(path);
|
||||
|
|
Loading…
Reference in a new issue