aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/scripts/gitAR.sh
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xscripts/gitAR.sh23
1 files changed, 4 insertions, 19 deletions
diff --git a/scripts/gitAR.sh b/scripts/gitAR.sh
index 2a067be..25cab48 100755
--- a/scripts/gitAR.sh
+++ b/scripts/gitAR.sh
@@ -11,31 +11,16 @@
11 11
12# Not really meant to be called by users, so don't bother validating the input and such. 12# Not really meant to be called by users, so don't bother validating the input and such.
13 13
14source common.sh
15getPrgDir
16
14type=$1 17type=$1
15title=$2 18title=$2
16
17# Figure out where we are, most of this mess is to troll through soft links.
18PRG="$0"
19while [ -h "${PRG}" ] ; do
20 ls=$(ls -ld "${PRG}")
21 link=`expr "${ls}" : '.*-> \(.*\)$'`
22 if expr "${link}" : '.*/.*' > /dev/null; then
23 PRG="${link}"
24 else
25 PRG=$(dirname "${PRG}")/"${link}"
26 fi
27done
28PRGDIR=$(dirname "${PRG}")
29pushd ${PRGDIR} >/dev/null
30PRGDIR=$(pwd)
31popd >/dev/null
32
33date=$(date '+%F_%T') 19date=$(date '+%F_%T')
34 20
35# Sanitize the name. Not removing [ or ], couldn't get that to work, only important for Windows.
36name=$(echo "${title}" | sed -e 's/[\\/:\*\?"<>\|@#$%&\0\x01-\x1F\x27\x40\x60\x7F. ]/_/g' -e 's/^$/NONAME/')
37# Convert the type to uppercase. 21# Convert the type to uppercase.
38gar="_git$(echo -n ${type} | tr '[:lower:]' '[:upper:]')AR" 22gar="_git$(echo -n ${type} | tr '[:lower:]' '[:upper:]')AR"
23name=$(sanitize "${title}")
39 24
40if [ -d ${PRGDIR}/../../backups/temp_backup${type}_${name} ]; then 25if [ -d ${PRGDIR}/../../backups/temp_backup${type}_${name} ]; then
41 echo "WARNING - Mess left over from last backup, not gonna run!" 26 echo "WARNING - Mess left over from last backup, not gonna run!"