emacs - add install.pl file
authorPeng Li <seudut@gmail.com>
Wed, 22 Jun 2016 17:06:35 +0000 (01:06 +0800)
committerPeng Li <seudut@gmail.com>
Wed, 22 Jun 2016 17:06:35 +0000 (01:06 +0800)
emacs.d/install.pl [new file with mode: 0755]

diff --git a/emacs.d/install.pl b/emacs.d/install.pl
new file mode 100755 (executable)
index 0000000..0fbe57e
--- /dev/null
@@ -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";