aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/scripts/gitAR.sh
diff options
context:
space:
mode:
authorDavid Walter Seikel2016-11-27 23:51:59 +1000
committerDavid Walter Seikel2016-11-27 23:51:59 +1000
commitc0ff56729a59dc30589de6af6120d825fbaa8cc3 (patch)
tree1c7e2f842548a5c9fef566d2045f3ad8aac603cb /scripts/gitAR.sh
parentWhite space and typo clean ups. (diff)
downloadopensim-SC_OLD-c0ff56729a59dc30589de6af6120d825fbaa8cc3.zip
opensim-SC_OLD-c0ff56729a59dc30589de6af6120d825fbaa8cc3.tar.gz
opensim-SC_OLD-c0ff56729a59dc30589de6af6120d825fbaa8cc3.tar.bz2
opensim-SC_OLD-c0ff56729a59dc30589de6af6120d825fbaa8cc3.tar.xz
Break out common script bits into their own file.
Diffstat (limited to 'scripts/gitAR.sh')
-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!"