denisidoro / navi

An interactive cheatsheet tool for the command-line
Apache License 2.0
14.61k stars 489 forks source link

`navi info cheats-path` ignores `$NAVI_PATH` and `$NAVI_CONFIG` #862

Open tapyu opened 7 months ago

tapyu commented 7 months ago

Describe the bug navi info cheats-path wrongly outputs ~/.local/share/navi/cheats when $NAVI_PATH is set to another value.

To Reproduce Steps to reproduce the behavior:

  1. mv ~/.local/share/navi/cheats ~/cheat_test (change ~/.local/share/navi/cheats if you place your .cheat files elsewhere).
  2. rm -rf ~/.local/share/navi
  3. export NAVI_PATH="/home/$USER/cheat_test"
  4. navi
  5. Note that navi is correctly using /home/$USER/cheat_test, which is defined by $NAVI_PATH
  6. Run navi info cheats-path and note that it wrongly says that cheat path is ~/.local/share/navi/cheats.

Expected behavior navi info cheats-path should print /home/$USER/cheat_test.

Screenshots image

Versions:

OS: Ubuntu 22.04.3 LTS x86_64 
Host: 20QRCTO1WW ThinkPad P73 
Kernel: 6.2.0-37-generic 
Uptime: 2 hours, 56 mins 
Packages: 2232 (dpkg), 11 (snap) 
Shell: zsh 5.8.1 
Resolution: 3840x2160 
DE: GNOME 42.9 
WM: Mutter 
WM Theme: Adwaita 
Theme: Yaru-dark [GTK2/3] 
Icons: Yaru [GTK2/3] 
Terminal: kitty 
CPU: Intel i7-9750H (12) @ 4.500GHz 
GPU: Intel CoffeeLake-H GT2 [UHD Graphics 630] 
GPU: NVIDIA Quadro P620 
Memory: 3021MiB / 23663MiB 
tapyu commented 7 months ago

It also happens if you set .cheat file paths in the navi config file instead of using $NAVI_PATH. navi info cheats-path also print the wrong paths in this situation.

tapyu commented 7 months ago

It also happens for navi info config-path when you set $NAVI_CONFIG, that is, navi info config-path ignores $NAVI_CONFIG and prints the wrong config file path.