speedpacer / gitbash_solarized

Solarized Git Bash and VIM
65 stars 19 forks source link

Running setup.sh twice will wipe out the original config files #3

Open chipilov opened 5 years ago

chipilov commented 5 years ago

If you run setup.sh twice for any reason, the original config files will essentially be wiped out.

In my case, when I ran setup.sh the first time, I got this (still note sure why): ./setup.sh: 12: /mnt/c/Users/stefan.c/linux/.bashrc: function: not found ./setup.sh: 14: /mnt/c/Users/stefan.c/linux/.bashrc: Syntax error: "}" unexpected

Later, I tried to run setup.sh again to see if the original error will still show up (after I tried a few changes) and. This second run wiped out my original config files (i.e. both .bashrc and bashrc_bkp were identical copies of .bashrc from this repo).

Maybe the setup.sh can create unique backups on each run (e.g. with a timestamp attached to the filename).

speedpacer commented 5 years ago

Yeah, it was admittedly a pretty crude way of safeguarding. The timestamp idea you suggested sounds good. I'll look into that and update soon.