rajasegar / alacritty-themes

:rainbow: :lollipop: Themes :candy: :heart_eyes: for Alacritty: A cross-platform GPU-accelerated Terminal emulator
MIT License
685 stars 70 forks source link

making backup doesnt support all linux config paths #172

Closed aigic8 closed 1 year ago

aigic8 commented 1 year ago

Descibe the bug

If alacritty config file is not $HOME/.config/alacritty/alacritty.yml, (in my case it is $HOME/.alacritty.yml) it will throw an error

Steps to reproduce

  1. Installation:
    • installed using npm i -g alacritty-themes
  2. Running:
    • just ran alacritty-themes

Expected Behavior

Running normally, without errors

Operating System

Arch Linux (Manjaro)

Screenshots

alac-bug

I've looked around the source code a bit. Looks like the problem is from createBackup function. On Linux, when it checks if the config exist, it will check both $HOME/.config/alacritty/alacritty.yml and $HOME/.alacritty.yml. But when it creates a backup file it will always use $HOME/.config/alacritty/alacritty.yml

JuanVqz commented 1 year ago

good call! I assumed the alacritty.yml file was located at $HOME/.config/alacritty/alacritty.yml, I don't like the idea of creating backups in the $HOME directory thought :thinking:

The solution may be use this function https://github.com/rajasegar/alacritty-themes/blob/4519540b7b465b85272adb539a9762e2a12fcfdb/src/helpers/index.js#L85 instead of https://github.com/rajasegar/alacritty-themes/blob/4519540b7b465b85272adb539a9762e2a12fcfdb/src/helpers/index.js#L61

do you want to fix it?

aigic8 commented 1 year ago

Thanks! But as you said, creating backup files in home direcotry is not really a neat solution. I think fixing this bug needs an oponionated solution which is beyond me.🙂

JuanVqz commented 1 year ago

a quick and good solution could be, even if the alacritty.yml file is in the $HOME directory we will create the backups files in this path $HOME/.config/alacritty/

JuanVqz commented 1 year ago

I just fixed the alacritty path, please download the latest version of alacritty-themes to get it working on your end :+1:

Thanks for reporting it

rajasegar commented 1 year ago

:tada: This issue has been resolved in version 5.0.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket: