Respect `~/.config/glab-cli/aliases.yml` symlink
Created by: forivall
Description
When ~/.config/glab-cli/aliases.yml
is a symlink, glab alias set/delete
should write to the linked file instead of destroying the symlink. My ~/.gitconfig is symlinked to my dotfiles repo, and i do the same with many of my configs. Git updates the linked file when using its config commands.
Expected Behavior vs Actual Behavior Expected: The linked file should be updated. Actual: The symlink is replaced with a copy of the file with the requested update.
Possible Fix Write to the linked file instead of replacing the symlink.
Steps to Reproduce
- Type this
mv ~/.config/glab-cli/aliases.yml $mydotfiles/glab-aliases.yml && ln -s $mydotfiles/glab-aliases.yml ~/.config/glab-cli/aliases.yml
- Then,
glab alias set mrb 'mr view --web'
- The config is no longer symlinked.
Logs (see above)
Your Environment
- Version used (Run
glab --version
):glab version 1.21.1 (2021-09-28)
- Operating System and version: macOS 10.15.7