rucker / dotfiles-manager

A script to compile your dotfiles!
MIT License
8 stars 0 forks source link

[ioutils] Vim swap files included for compilation #56

Open rucker opened 2 years ago

rucker commented 2 years ago

The following output was observed where several swap files existed in the input dir but only one was skipped. The rest were compiled into .bashrc, resulting in a bug originally filed here.

Processing file: .bashrc
        Reading input file 99-bashrc
        Reading input file 98-bashrc_mac
        Reading input file 97-bashrc_local
        Reading input file .98-bashrc_win.swp
Input file <_io.TextIOWrapper name='C:/Users/rick/repos/dotfiles/src\\.98-bashrc_win.swp' mode='r' encoding='cp1252'> is not a valid UTF-8 file. Skipping...
        Reading input file .98-bashrc_mac.swp
        Reading input file .97-bashrc_local.swp
        Backing up C:\Users\rick\.bashrc to C:/Users/rick/repos/dotfiles/src\backups\bashrc_2022-02-28_15-31-27.bak
        Writing input file contents to output file C:\Users\rick\.bashrc
Done with .bashrc

The current implementation attempts to detect binary input files by catching a UnicodeDecodeError which is not a thorough enough solution. I attempted to reproduce the behavior by opening up multiple input files in vim (taking care to dirty one of them) but I did not observe any of the swap files being skipped.