-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: implemented hideDotfiles feature in the backend #1148
Conversation
The path provided to the function are relative paths with directory prefixes, so `strings.HasPrefix("/a/b/c/.docker.json", "/.”)` does not work and we’d need the base name. That’s just an extra import and sort of out of line with the rest of the rules because they’re all Regex, but if you wanna do let this way, I don’t mind.
…On 18 Nov 2020, 5:22 PM +0800, Oleg Lobanov ***@***.***>, wrote:
@o1egl commented on this pull request.
In rules/rules.go:
> +var MatchHidden = Rule{
+ Regex: true,
+ Regexp: &Regexp{Raw: `\/\..*$`},
+}
\/\..*$ and strings.HasPrefix("/.") are equal. So I don't understand why it shouldn't work. Better would be to get the base name and then check if it starts from .
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
Prefix based comparison is much faster than the regexp. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit
Use `strings.HasPrefix` to avoid panic on empty string. Co-authored-by: Oleg Lobanov <[email protected]>
test naming convention Co-authored-by: Oleg Lobanov <[email protected]>
Co-authored-by: Oleg Lobanov <[email protected]>
Any more changes needed? |
feat: add hide dotfiles param (filebrowser#1148)
@NieTiger @o1egl Is this a configurable option when launching in a docker container? I looked in the source and I didn't see anything that would suggest it, but I wanted to ask to confirm. Didn't see it in the documentation as well. I am looking for dotfiles to be hidden by default. Appreciate the help! Thanks. |
@smithzss this param is only available in the UI. |
@o1egl would you consider a PR implementing a flag for this param in the Cmd ? |
This PR addresses #1084.
Per @o1egl, I've rewritten my previous PR (#1085) to move the filtering logic to the backend.
By default the
hideDotfiles
options is turned off, and it can be turned on in profile settings.