tauri: [bug] Enumerate hidden directories on linux

Describe the bug

Hi, I’m using in my code

readDir(path, { dir: BaseDirectory.Home, recursive: false });

from module “fs” and there is impossible to specify all subdirectories in “allowlist” -> “scope”

“**” can browse non-hidden directories like

"$HOME/**/*.*"

, but not hidden directories. “.**” is not accepted by tauri. And print error:

thread 'main' panicked at 'error while running tauri application: GlobPattern(PatternError { pos: 10, msg: "recursive wildcards must form a single path component" })', src/main.rs:52:10

I think all the hidden, non-hidden directories can be allowed by e.g.:

$ echo {.**,**}/{.**,**}/{.*,*}

I haven’t found a way, how to do this. I need to find all files across all the directories.

Reproduction

In description. You can try search e.g. directory with .git directory

Expected behavior

Enumerate hidden directories.

Platform and versions

$ npm run tauri info
 syncdirs@0.0.0 tauri
> tauri info


[✘] Environment
    - OS: Fedora 38.0.0 X64
    ✔ webkit2gtk-4.0: 2.40.2
    ✘ rsvg2: not installed
      Visit https://tauri.app/v1/guides/getting-started/prerequisites to learn more about tauri prerequisites
    ✔ rustc: 1.70.0 (90c541806 2023-05-31) (Fedora 1.70.0-1.fc38)
    ✔ Cargo: 1.70.0
    ⚠ rustup: not installed!
      If you have rust installed some other way, we recommend uninstalling it
      then use rustup instead. Visit https://rustup.rs/
    ⚠ Rust toolchain: couldn't be deteceted!
      maybe you don't have rustup installed? if so, Visit https://rustup.rs/
    - node: 18.16.0
    - yarn: 1.22.19
    - npm: 9.5.1

[-] Packages
    - tauri [RUST]: 1.2.4
    - tauri-build [RUST]: 1.2.1
    - wry [RUST]: 0.23.4
    - tao [RUST]: 0.15.8
    - @tauri-apps/api [NPM]: 1.3.0
    - @tauri-apps/cli [NPM]: 1.3.1

[-] App
    - build-type: bundle
    - CSP: unset
    - distDir: ../dist
    - devPath: http://localhost:1420/
    - framework: React
    - bundler: Vite
npm notice 
npm notice New minor version of npm available! 9.5.1 -> 9.7.1
npm notice Changelog: https://github.com/npm/cli/releases/tag/v9.7.1
npm notice Run npm install -g npm@9.7.1 to update!
npm notice


### Stack trace

_No response_

### Additional context

I'm doing my own synchonization file manager and I need sync all the files. Not skip some of them because of this issue.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 23 (13 by maintainers)

Commits related to this issue

Most upvoted comments

Hey @amrbashir, how this can be configured for Tauri 2.0? Doc is really confusing: https://v2.tauri.app/references/config/#fsscope fs plugin seems to not have “requireLiteralLeadingDot” key in capabilities settings.