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

Cheat fails to show when the filepath contains directories that end in ".git" #711

Open
jdqo opened this issue Dec 20, 2022 · 0 comments
Open
Labels

Comments

@jdqo
Copy link

jdqo commented Dec 20, 2022

A description of the problem
Cheat fails to display cheatsheets if the filepath contains directories with names ending .git ie. cheats.git

How to reproduce:

cat ~/.config/cheat/conf.yml
# editor: vim
# colorize: true
# style: monokai
# formatter: terminal256
# pager: less -FRX
# cheatpaths:
#   - name: community
#     path: /usr/share/cheat/cheatsheets/community
#     tags: [community]
#     readonly: true
#   - name: personal
#     path: ~/personal/cheat
#     tags: [personal]
#     readonly: false

mkdir -pv ~/personal/cheat
# mkdir: created directory '/home/<user>/personal'
# mkdir: created directory '/home/<user>/personal/cheat'

echo "hello" > ~/personal/cheat/hello
cheat -d
# community: /usr/share/cheat/cheatsheets/community
# personal:  /home/jdqo/personal/cheat

cheat hello
# hello

# O.K.

sed -i 's/personal\/cheat/personal.git\/cheat/g'  ~/.config/cheat/conf.yml
mv ~/personal{,.git}
# renamed '~/personal' -> '~/personal.git'

cheat -d
# community: /usr/share/cheat/cheatsheets/community
# personal:  /home/jdqo/personal.git/cheat
cheat -e hello # Opens O.K., add " world!"
cat /home/jdqo/personal.git/cheat/hello
# hello world!
cheat hello
# No cheatsheet found for 'hello'.
# :(

cheat version info
4.4.0

cheat configuration info

editor: vim
colorize: true
style: monokai
formatter: terminal256
pager: less -FRX
cheatpaths:
  - name: community
    path: /usr/share/cheat/cheatsheets/community
    tags: [community]
    readonly: true
  - name: personal
    path: ~/personal/cheat # works
    # path: ~/personal.git/cheat fails
    tags: [personal]
    readonly: false

EDIT: formatting.

@jdqo jdqo added the bug label Dec 20, 2022
@jdqo jdqo changed the title Cheat fails to show when the filepath directories with ".git" ending Cheat fails to show when the filepath contains directories that end in ".git" Dec 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant