add install file for zsh
authorPeng Li <seudut@gmail.com>
Sat, 18 Feb 2017 07:50:44 +0000 (15:50 +0800)
committerPeng Li <seudut@gmail.com>
Sat, 18 Feb 2017 07:50:44 +0000 (15:50 +0800)
zsh/install.pl [new file with mode: 0755]

diff --git a/zsh/install.pl b/zsh/install.pl
new file mode 100755 (executable)
index 0000000..efed502
--- /dev/null
@@ -0,0 +1,18 @@
+#!/usr/bin/perl -w
+
+use strict;
+use File::Basename;
+use Cwd;
+use Cwd "abs_path";
+
+my $home = $ENV{'HOME'};
+my $zshDir = dirname abs_path(__FILE__);
+my $zshrc = $zshDir . "/zshrc";
+
+die "~/.zsh or ~/.zshrc exist. Backup them first.\n" if -e "$home/.zsh" or -e "$home/.zshrc";
+
+print `ln -s $zshDir $home/.zsh`;
+print `ln -s $zshrc $home/.zshrc`;
+
+print "Done" unless $?;
+