From 587667b8a28425a2a8314e305ab86be39593dad9 Mon Sep 17 00:00:00 2001 From: Peng Li Date: Thu, 23 Jun 2016 01:06:35 +0800 Subject: [PATCH] emacs - add install.pl file --- emacs.d/install.pl | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 emacs.d/install.pl diff --git a/emacs.d/install.pl b/emacs.d/install.pl new file mode 100755 index 0000000..0fbe57e --- /dev/null +++ b/emacs.d/install.pl @@ -0,0 +1,17 @@ +#!/usr/bin/perl -w +# +use 5.010; +use strict; + +##my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime; +my $date = `date +%m%d`; +chomp $date; + +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; +} + +## link emacs.d folder +! system "ln", "-s", "$ENV{HOME}/dotfiles/emacs.d", "$ENV{HOME}/.emacs.d" or die; +say "DONE"; -- 2.11.0