1
0
mirror of https://github.com/klmp200/vim-sync.git synced 2024-11-24 18:14:22 +00:00

Better backup

This commit is contained in:
Antoine Bartuccio 2016-07-18 09:25:19 +02:00
parent 9729f2467b
commit e7bf265776

View File

@ -3,10 +3,13 @@
use 5.018; use 5.018;
use autodie; use autodie;
use Cwd 'realpath'; use Cwd 'realpath';
use File::Copy 'move';
say "Backuping your original vimrc"; say "Backuping your original vimrc";
move "$ENV{'HOME'}/.vimrc", "$ENV{'HOME'}/.vimrc.old"; eval {
rename "$ENV{'HOME'}/.vimrc", "$ENV{'HOME'}/.vimrc.old";
} or do {
say "No file to backup";
};
say "Writing your new config"; say "Writing your new config";
open my $vimrc, '>', "$ENV{'HOME'}/.vimrc"; open my $vimrc, '>', "$ENV{'HOME'}/.vimrc";