ChrisTitusTech / linutil

Chris Titus Tech's Linux Toolbox - Linutil is a distro-agnostic toolbox designed to simplify everyday Linux tasks.
https://christitus.com
MIT License
2.01k stars 170 forks source link

Bash Prompt munched my .bashrc #295

Closed Zazucki closed 1 day ago

Zazucki commented 1 week ago

Describe the bug

Running the bash prompt twice ended up deleting my original .bashrc via the .bashrc.bak file not being checked if it exists already before being overwritten.

To Reproduce

run bash-prompt script more than once (common with failures)

Expected behavior

Ideally, number the .baks or at least check if it exists.

Screenshots

N/A

Additional context

FWIW this is my fault, but with the script having some problems I could see people making the same mistake, retrying after a failure and then losing their original .bashrc because it made a backup of the titus rc file that it already wrote from the first (failed) attempt, which overwrites the .bak that contains their real original .bashrc

nnyyxxxx commented 1 week ago

This should be moved over to the mybash repository.