installer changed

This commit is contained in:
lxsameer 2011-07-29 18:02:31 +04:30
parent 4780984d64
commit 43cb96dbd5
2 changed files with 39 additions and 13 deletions

28
install.sh Normal file → Executable file
View File

@ -1,13 +1,13 @@
#! /bin/bash
echo "Enter your full name (you can change it later in top level customization): "
fullname=`read`
read fullname
echo "Enter your mail: "
mail=`read`
read mail
echo "Where is your workspace directory: "
workspace=`read`
read workspace
echo "Where do you want to put pyemacs.sh file: "
addr=`read`
read addr
kusohome=`pwd`
mkdir -p ~/.emacs.d
@ -15,14 +15,16 @@ if [ -x ~/.emacs ]; then
cp ~/.emacs ~/.emacs.backup
fi
cp conf/emacs.d/* ~/.emacs.d -rv
cp conf/emacs.d/* ~/.emacs.d -r
echo "Creating ~/.emacs"
mkdir -p $addr
cp conf/bin/pyemacs.sh $addr/ -rv
chmod u+x $addr/pyemacs.sh
mkdir -p "$addr"
cp conf/bin/pyemacs.sh $addr/ -r
chmod u+x $addr/pyemacs.sh -v
cp conf/dotemacs ~/.emacs
sed "s/--EMAIL--/$mail/" -i ~/.emacs
sed "s/--FULLNAME--/$fullname/" -i ~/.emacs
sed "s/--WORKSPACE--/$workspace/" -i ~/.emacs
sed "s/--ADDR--/$addrcp/" -i ~/.emacs
sed "s/--KUSOHOME--/$kusohome/" > ~/.emacs
echo "python ./rep.py $mail $fullname $workspace $addr $kusohome"
python ./rep.py $mail $fullname $workspace $addr $kusohome
#sed "s/--EMAIL--/$mail/" -i ~/.emacs
#sed "s/--FULLNAME--/$fullname/" -i ~/.emacs
#sed "s/--WORKSPACE--/$workspace/" -i ~/.emacs
#sed "s/--ADDR--/$addr/" -i ~/.emacs
#sed "s/--KUSOHOME--/$kusohome/" -i ~/.emacs

24
rep.py Normal file
View File

@ -0,0 +1,24 @@
#! /usr/bin/env python
import os
import sys
MAIL = sys.argv[1]
FULLNAME = sys.argv[2]
WORKSPACE = sys.argv[3]
ADDR = sys.argv[4]
KUSOHOME = sys.argv[5]
HOME = os.environ['HOME']
fd = open("%s/.emacs" % HOME)
buf = fd.read()
fd.close()
buf.replace("--EMAIL--", MAIL)
buf.replace("--FULLNAME--", FULLNAME)
buf.replace("--WORKSPACE--", WORKSPACE)
buf.replace("--ADDR--", ADDR)
buf.replace("--KUSOHOME--", KUSOHOME)
print ">> ", buf
fd = open("%s/.emacs" % HOME, "w+")
fd.write(buf)
fd.close()