Skip to content

Commit 54ff5c7

Browse files
nheuilletpanekjNoe Heuillet
authored
prevent volt loading on files and hidden file/folders (lapce#1724)
Co-authored-by: Jakub Panek <[email protected]> Co-authored-by: Noe Heuillet <[email protected]>
1 parent 16e6449 commit 54ff5c7

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
1414
### Bug Fixes
1515

16+
- [#1724](https://github.com/lapce/lapce/pull/1724): files and hidden folders no longer will be considered when trying to open a plugin base folder
17+
1618
## 0.2.4
1719

1820
### Features/Changes

lapce-proxy/src/plugin/wasi.rs

+7
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,13 @@ pub fn find_all_volts() -> Vec<VoltMetadata> {
233233
d.read_dir().ok().map(|dir| {
234234
dir.filter_map(|result| {
235235
let entry = result.ok()?;
236+
let metadata = entry.metadata().ok()?;
237+
238+
if metadata.is_file()
239+
|| entry.file_name().to_str()?.starts_with('.')
240+
{
241+
return None;
242+
}
236243
let path = entry.path().join("volt.toml");
237244
load_volt(&path).ok()
238245
})

0 commit comments

Comments
 (0)