mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-07-14 16:37:22 +02:00
feat(fs): improved API (#751)
* feat(fs): improved API * fmt * fix unix builds * again * clippy * clippy * fix import in docs examples * fmt, clippy * Update linux.rs * add API for watch * fix with `watcher` feature flag * use baseDir for all commands * do not export close function * fix build * organize and address review comments * fmt * generated files * rename FsFile to FileHandle, move APIs and docs * extend example * extend `Resource` * actually extend it --------- Co-authored-by: FabianLars <fabianlars@fabianlars.de> Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<script>
|
||||
import { open, save, confirm } from "@tauri-apps/plugin-dialog";
|
||||
import { readBinaryFile } from "@tauri-apps/plugin-fs";
|
||||
import { readFile } from "@tauri-apps/plugin-fs";
|
||||
|
||||
export let onMessage;
|
||||
export let insecureRenderHtml;
|
||||
@@ -55,7 +55,7 @@
|
||||
} else {
|
||||
var pathToRead = typeof res === "string" ? res : res.path;
|
||||
var isFile = pathToRead.match(/\S+\.\S+$/g);
|
||||
readBinaryFile(pathToRead)
|
||||
readFile(pathToRead)
|
||||
.then(function (response) {
|
||||
if (isFile) {
|
||||
if (
|
||||
|
||||
Reference in New Issue
Block a user