-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1e420bc
commit b902f79
Showing
20 changed files
with
3,156 additions
and
2,624 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,8 @@ dist | |
dist-ssr | ||
*.local | ||
|
||
.vscode/* | ||
|
||
src-tauri/binaries/* | ||
!src-tauri/binaries/.gitkeep | ||
|
||
|
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,17 @@ | ||
export async function readBinaryFile( | ||
filePath: string | ||
filePath: string, | ||
): Promise<Uint8Array> { | ||
if (process.env.NODE_ENV === 'test') { | ||
const { readFile } = await import('fs/promises'); | ||
return readFile(filePath); | ||
return (await import('fs/promises')).readFile(filePath); | ||
} else { | ||
const { readBinaryFile: r } = await import('@tauri-apps/api/fs'); | ||
return r(filePath); | ||
return (await import('@tauri-apps/plugin-fs')).readFile(filePath); | ||
} | ||
} | ||
|
||
export async function readTextFile(filePath: string): Promise<string> { | ||
if (process.env.NODE_ENV === 'test') { | ||
const { readFile } = await import('fs/promises'); | ||
return readFile(filePath, 'utf-8'); | ||
return (await import('fs/promises')).readFile(filePath, 'utf-8'); | ||
} else { | ||
const { readTextFile: r } = await import('@tauri-apps/api/fs'); | ||
return r(filePath); | ||
return (await import('@tauri-apps/plugin-fs')).readTextFile(filePath); | ||
} | ||
} |
Oops, something went wrong.