X-Git-Url: http://47.100.26.94:8080/?a=blobdiff_plain;f=emacs.d%2Finstall.pl;h=333531a3581fd80f48010f0e49e9f17b816bf086;hb=105d2fb36393f1ba82cc5f296f3bf46d4b4f2313;hp=0fbe57eb1ec68ed149da31baa8069b14b35c6ea4;hpb=587667b8a28425a2a8314e305ab86be39593dad9;p=dotfiles.git diff --git a/emacs.d/install.pl b/emacs.d/install.pl index 0fbe57e..333531a 100755 --- a/emacs.d/install.pl +++ b/emacs.d/install.pl @@ -4,12 +4,21 @@ use 5.010; use strict; ##my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime; -my $date = `date +%m%d`; -chomp $date; +chomp (my $date = `date +%m%d`); if (-e "$ENV{HOME}/.emacs.d" ) { - say "~/.emacs.d folder already exists, rename as ~/.emacs.d_bak_$date"; - ! system "mv", "$ENV{HOME}/.emacs.d", "$ENV{HOME}/.emacs.d_bak_$date" or die; + print "~/.emacs.d folder already exists.\nRename as ~/.emacs.d_bak_$date and continue yes (y) or no (n)? "; + chomp (my $yorn = ); + + while ($yorn ne "y" and $yorn ne "n") { + print "Input y or n: "; + chomp ($yorn = ); + } + + exit if $yorn eq "n"; + + ! system "mv", "$ENV{HOME}/.emacs.d", "$ENV{HOME}/.emacs.d_bak_$date" or die + if $yorn eq "y"; } ## link emacs.d folder