Skip to content
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

How to ignore files/dotfiles? #492

Closed
zeitchef opened this issue Nov 3, 2019 · 6 comments
Closed

How to ignore files/dotfiles? #492

zeitchef opened this issue Nov 3, 2019 · 6 comments

Comments

@zeitchef
Copy link

zeitchef commented Nov 3, 2019

Dotfiles are being listed by cheat as cheatsheet files (eg. .DS_Store) - anyway
to ignore these?

@chrisallenlane
Copy link
Member

That's weird. cheat should be ignoring dotfiles by default:

// ignore dotfiles. Otherwise, we'll likely load .git/*
if strings.HasPrefix(title, ".") {
return nil
}

Please show me the output from the following commands:

cheat -v
cheat -d

Thanks.

@zeitchef
Copy link
Author

zeitchef commented Nov 5, 2019

Sure thing, @chrisallenlane.

// cheat -v
3.0.3

// cheat -d
community: /Users/scott/.cheat/community
work: /Users/scott/.cheat/word
personal: /Users/scott/.cheat/personal

Running cheat -l lists dotfiles along with cheatsheets.

Screen Shot 2019-11-05 at 08 59 19

@chrisallenlane
Copy link
Member

Oh, OK - I think I see what's happening here:

The current check simply looks for a . at the start of title. The intention was to prevent .git directories from being recognized as cheatsheets, but I didn't consider .DS_Store and other files that may end up polluting a sheet repository.

Your .DS_Store "cheatsheets" are all nested within other subdirectories, like rb/.DS_Store. Because the . isn't the first character in title in such cases, the current check will fail.

So, yeah, that's a bug. Thanks for sharing this information. I'll get a patch worked up in the next day or two.

@chrisallenlane
Copy link
Member

@zeitchef, thanks again for reporting this. This should now be resolved in version 3.0.4. Please upgrade and let me know if you encounter any further errors.

@zeitchef
Copy link
Author

zeitchef commented Nov 6, 2019

@chrisallenlane - thanks for the speedy response! Works as expected on my side.

@chrisallenlane
Copy link
Member

Excellent 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants