aboutsummaryrefslogtreecommitdiff
path: root/sh
diff options
context:
space:
mode:
authorbeber <beber>2005-10-13 17:05:14 +0000
committerbeber <beber>2005-10-13 17:05:14 +0000
commit88d2d1531f3b909ba023638df2417ea833486bef (patch)
tree12758c0655810b2e7729d20e92abb67378c71846 /sh
parentwhoami is better ! (diff)
downloadespik-88d2d1531f3b909ba023638df2417ea833486bef.tar.xz
Do more check and be more usable
Diffstat (limited to 'sh')
-rw-r--r--sh/eci.sh25
1 files changed, 23 insertions, 2 deletions
diff --git a/sh/eci.sh b/sh/eci.sh
index b1132d1..50749ce 100644
--- a/sh/eci.sh
+++ b/sh/eci.sh
@@ -1,11 +1,32 @@
#!/bin/bash
+PROJECT_PATH="$HOME/dev/espik"
+
TMPFILE="/tmp/.eci.$RANDOM"
+if [ ! -e $PROJECT_PATH ]; then
+ echo "PROJECT_PATH defined ($PROJECT_PATH) doesn't exist"
+ exit -1
+fi
+
+if [ -z "$EDITOR" ]; then
+ echo "EDITOR is not set"
+ exit -1
+elif [ ! -e $(which $EDITOR) ]; then
+ echo "EDITOR doesn't exist"
+ exit -1
+fi
+
touch $TMPFILE
+if [ ! -e $TMPFILE ]; then
+ echo "Cannot write to /tmp"
+ echo "Check perms ;)"
+ exit -1
+fi
+
chmod 600 $TMPFILE
-cd $HOME/dev/espik
+cd $PROJECT_PATH
echo "
--This line and thoses under will be ignored--
@@ -33,7 +54,7 @@ $(whoami) from $(if [ `uname -o` = "Cygwin" ]; then hostname; else hostname -f;
$(cat ${TMPFILE}.send)
File changes :
-$(svn st | grep -v '^?')" >> $HOME/dev/espik/ChangeLog
+$(svn st | grep -v '^?')" >> $PROJECT_PATH/ChangeLog
svn ci -m "$(cat ${TMPFILE}.send)"