nushell/nushell
watch's glob seems to work differently than `ls | glob`
オープン
#7,022 opened on 2022/11/06
A:file-systemA:globcategory:inconsistent-behaviorhelp wanted
Repository metrics
- Stars
- (39,478 個のスター)
- PR merge metrics
- (平均マージ 4d 1h) (30d で 123 merged PRs)
説明
Describe the bug
ls | glob '<[!.]*/>[!.]*'
will recursively list files but ignore dot-files/dirs
but
▶ watch . -v --glob=<[!.]*/>[!.]* { |op, path, new_path| $"($op) ($path) ($new_path)"}
Absolute glob path: "/home/cole/code/nixcfg/<[!.]*/>[!.]*"
Now watching files at "/home/cole/code/nixcfg". Press ctrl+c to abort.
NoticeWrite("/home/cole/code/nixcfg/foo")
Write("/home/cole/code/nixcfg/foo")
Matches glob: false
Create("/home/cole/code/nixcfg/.git/index")
Matches glob: false
just results in no matches
How to reproduce
Try to use watch without triggering on .git changes.
Expected behavior
There to be some way to achieve this with the built in glob feature
Screenshots
No response
Configuration
| key | value |
| ------------------ | ----------------------------------------------- |
| version | 0.70.0 |
| branch | |
| commit_hash | |
| build_os | linux-x86_64 |
| build_target | x86_64-unknown-linux-gnu |
| rust_version | rustc 1.64.0 |
| cargo_version | cargo 1.64.0 |
| pkg_version | 0.70.0 |
| build_time | 1980-01-01 00:00:00 +00:00 |
| build_rust_channel | release |
| features | database, dataframe, default, trash, which, zip |
| installed_plugins | |
Additional context
No response