alacritty-themes icon indicating copy to clipboard operation
alacritty-themes copied to clipboard

Too many backups

Open alexmailo opened this issue 2 years ago • 3 comments

Describe the bug

Looks like every time it runs, it creates a backup file for some reason. Was wondering if that is necessary or is it a bug?

To Reproduce

Steps to reproduce the behavior:

  1. Installation
  • [ ] I run it via npx alacritty-themes
  • [x] I installed it via npm i -g alacritty-themes (global installation)
  1. Run alacritty-themes
  • [ ] Did you add params? yes, I type "alacritty-themes Ayu-Dark"
  • [x] Did you add params? no, I just type "alacritty-themes" then click up/down keys
  1. See error

Expected behavior

Just run normally without creating multiple backup files

Operating System:

  • [ ] Windows
  • [ ] Ubuntu
  • [ ] Pop Os
  • [x] Arch
  • [ ] Other, which one?

Add your alacritty.yml content

font:
  size: 14
  normal:
    family: Fira Code Medium
    # in terminal of angela
    # family: Monaco
    # family: Cousine
    style: Regular
  offset:
    x: 0
    y: 5
shell:
  program: /bin/zsh
traw_bold_text_with_bright_colors: false
window:
  # requires compositor running
  opacity: 1
  padding:
    x: 10
    y: 10
cursor:
  style:
    shape: Beam
    blinking: On
import:
  - ~/.config/alacritty/themes/challenger-deep.yml
colors:
  name: 3024 (dark)
  author: Chris Kempson
  primary:
    background: "#090300"
    foreground: "#a5a2a2"
  cursor:
    text: "#090300"
    cursor: "#a5a2a2"
  normal:
    black: "#090300"
    red: "#db2d20"
    green: "#01a252"
    yellow: "#fded02"
    blue: "#01a0e4"
    magenta: "#a16a94"
    cyan: "#b5e4f4"
    white: "#a5a2a2"
  bright:
    black: "#5c5855"
    red: "#db2d20"
    green: "#01a252"
    yellow: "#fded02"
    blue: "#01a0e4"
    magenta: "#a16a94"
    cyan: "#b5e4f4"
    white: "#f7f7f7"
theme: 3024.dark

Screenshots

alacritty-themes

alexmailo avatar Jul 16 '22 16:07 alexmailo

Hey @alexmailo thank you for opening the issue, we are creating backups because some users have ran on corrupted alacritty.yml file.

We are aware of you will ended up with several backup files but we didn't agree in the best way to manage them, should we remove all of them and keep the last backup? What happen if the last backup is corrupted and we removed the good one? That's the reason for now we think it's easy to the user remove them manually with the following command rm ~/.config/alacritty/

Do you have any idea to improve it?

Best!

JuanVqz avatar Jul 16 '22 18:07 JuanVqz

HI @JuanVqz , thanks for the quick response.

  • Me personally, I wouldn't even allow the user to run the script on a corrupted alacritty.conf. I would probably throw an error saying that the config is corrupted or something, and let them solve it. After all, it is not your fault they got a corrupted config file.

  • With respect to the backups, I think that having the user remove backups manually is not an option as it will get chaotic (as in probably thousands of backups) and that there should only be one backup in case the user regrets applying the changes, but that is just my opinion.

Other than that I love this app and am probably going to make a PR with some new themes if that is okay.

alexmailo avatar Jul 16 '22 19:07 alexmailo

HI @JuanVqz , thanks for the quick response.

* Me personally, I wouldn't even allow the user to run the script on a corrupted `alacritty.conf`. I would probably throw an error saying that the config is corrupted or something, and let them solve it. After all, it is not your fault they got a corrupted config file.

* With respect to the backups, I think that having the user remove backups manually is not an option as it will get chaotic (as in probably thousands of backups) and that there should only be one backup in case the user regrets applying the changes, but that is just my opinion.

Probably, we are breaking the alacritty.yml when changing themes faster here you have the related issue https://github.com/rajasegar/alacritty-themes/issues/131

Other than that I love this app and am probably going to make a PR with some new themes if that is okay.

Nice, themes are pretty welcome

JuanVqz avatar Jul 17 '22 13:07 JuanVqz

I'll add a flag to remove backups, in the mean time I'll close this issue, if you have an idea how to manage backups feel free to open a new issue, thank! 😉

JuanVqz avatar Aug 21 '22 18:08 JuanVqz