Skip to content

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

@jdqo

Description

@jdqo

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions