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 files tagged personal going into unexpected folder #712

Open
apenngrace opened this issue Dec 27, 2022 · 3 comments
Open

Cheat files tagged personal going into unexpected folder #712

apenngrace opened this issue Dec 27, 2022 · 3 comments

Comments

@apenngrace
Copy link

apenngrace commented Dec 27, 2022

Thanks for submitting a bug report. Please provide the following information:

A description of the problem
The file ~/.config/cheat/conf.yml specifies that cheat sheets tagged personal go into the folder ~/.config/cheat/cheatsheets/personal, but those sheets are being saved in the folder
~/.cheat instead.

For instance, if I create a new sheet named foo with cheat -e foo -t personal, that sheet
ends up in the location ~/.cheat/foo instead of ~/.config/cheat/cheatsheets/personal/foo. It is unclear to me when a sheet will end up in one location or the other.

cheat version info
4.4.0

cheat configuration info
If your bug pertains to how cheatsheets are loaded and/or displayed, please
paste here the following information:

  1. The output of cheat -d
 » cheat -d
community: /Users/andrew/.config/cheat/cheatsheets/community
personal:  /Users/andrew/Dropbox/computer_stuff/unix_files/personal_cheat_sheets
  1. The contents of your conf.yml file
---
# The editor to use with 'cheat -e <sheet>'. Defaults to $EDITOR or $VISUAL.
editor: vim

# Should 'cheat' always colorize output?
colorize: true

# Which 'chroma' colorscheme should be applied to the output?
# Options are available here:
#   https://github.com/alecthomas/chroma/tree/master/styles
style: monokai

# Which 'chroma' "formatter" should be applied?
# One of: "terminal", "terminal256", "terminal16m"
formatter: terminal16m

# Through which pager should output be piped? (Unset this key for no pager.)
pager: less -FRX

# The paths at which cheatsheets are available. Tags associated with a cheatpath
# are automatically attached to all cheatsheets residing on that path.
#
# Whenever cheatsheets share the same title (like 'tar'), the most local
# cheatsheets (those which come later in this file) take precedent over the
# less local sheets. This allows you to create your own "overides" for
# "upstream" cheatsheets.
#
# But what if you want to view the "upstream" cheatsheets instead of your own?
# Cheatsheets may be filtered via 'cheat -t <tag>' in combination with other
# commands. So, if you want to view the 'tar' cheatsheet that is tagged as
# 'community' rather than your own, you can use: cheat tar -t community
cheatpaths:

  # Paths that come earlier are considered to be the most "global", and will
  # thus be overridden by more local cheatsheets. That being the case, you
  # should probably list community cheatsheets first.
  #
  # Note that the paths and tags listed below are placeholders. You may freely
  # change them to suit your needs.
  #
  # Community cheatsheets must be installed separately, though you may have
  # downloaded them automatically when installing 'cheat'. If not, you may
  # download them here:
  #
  # https://github.com/cheat/cheatsheets
  #
  # Once downloaded, ensure that 'path' below points to the location at which
  # you downloaded the community cheatsheets.
  - name: community
    path: /Users/andrew/.config/cheat/cheatsheets/community
    tags: [ community ]
    readonly: true

  # If you have personalized cheatsheets, list them last. They will take
  # precedence over the more global cheatsheets.
  - name: personal
    path: /Users/andrew/.config/cheat/cheatsheets/personal
    tags: [ personal ]
    readonly: false

  # While it requires no configuration here, it's also worth noting that
  # 'cheat' will automatically append directories named '.cheat' within the
  # current working directory to the 'cheatpath'. This can be very useful if
  # you'd like to closely associate cheatsheets with, for example, a directory
  # containing source code.
  #
  # Such "directory-scoped" cheatsheets will be treated as the most "local"
  # cheatsheets, and will override less "local" cheatsheets. Likewise,
  # directory-scoped cheatsheets will always be editable ('readonly: false').
@apenngrace apenngrace added the bug label Dec 27, 2022
@chrisallenlane
Copy link
Member

Hi, @apenngrace

I'm sorry it has taken me an entire year to get back to you on this 😞

I can't reproduce this locally. Two questions:

  1. Do you still see this behavior on the current version of cheat?
  2. Are you using symlinks that might be causing issues?

I ask 2 because the output of cheat -d does not look how I'd expect, given the contents of your conf.yml file. I would expect to see:

community: /Users/andrew/.config/cheat/cheatsheets/community
personal: /Users/andrew/.config/cheat/cheatsheets/personal

@apenngrace
Copy link
Author

Yes, the personal folder is using a symlink. I was using a dropbox folder for the storage of those files so that when I go between my two work computers, the cheat sheets just sync automatically for me.

I'm guessing that you're going to suggest that I change it from a symlink back to a local folder and see if I still get that behavior.

@chrisallenlane
Copy link
Member

Yes, the personal folder is using a symlink. I was using a dropbox folder for the storage of those files so that when I go between my two work computers, the cheat sheets just sync automatically for me.

Gotcha. I think that's a relatively common use-case, so I want to make sure this works.

I'm guessing that you're going to suggest that I change it from a symlink back to a local folder and see if I still get that behavior.

Please do, if you have the time 🙂

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