Improve scripts for non-cygwin user

This commit is contained in:
RobinFleige
2018-08-21 07:56:37 +02:00
parent 76696ce281
commit 6084df47a6
2 changed files with 24 additions and 6 deletions
+15 -3
View File
@@ -23,7 +23,13 @@ find_project_home ()
return 0
fi
echo $1 | sed -e 's/\/cygdrive\/\([a-zA-Z]\)/\1:/'
#editing the filepath, so it fits for eclipse #currently save works for cygwin, gitbash and linux
if [ "$OSTYPE" == "cygwin" ]; then
echo $1 | sed 's/^\/cygdrive\/\(.\)/\/\1:/'
fi
if [ "$OSTYPE" == "msys" ]; then
echo $1 | sed 's/^\(\/[[:alpha:]]\)\//\1:\//'
fi
}
# this holds for default installation
@@ -40,8 +46,14 @@ if [[ "$PROJECT_HOME" == "" ]]; then
exit 1
fi
if [ "$SERVERS_HOME" = "" ]; then
SERVERS_HOME=`echo "$USER_HOME/servers" | sed -e 's/\/cygdrive\/\([a-zA-Z]\)/\1:/'`
if [ "$SERVERS_HOME" = "" ]; then#reading the filepath and editing it, so it fits for eclipse #currently save works for cygwin, gitbash and linux
SERVERS_HOME="$USER_HOME/servers"
if [ "$OSTYPE" == "cygwin" ]; then
SERVERS_HOME=`echo "$USER_HOME/servers" | sed 's/^\/cygdrive\/\(.\)/\/\1:/'`
fi
if [ "$OSTYPE" == "msys" ]; then
SERVERS_HOME=`echo "$USER_HOME/servers" | sed 's/^\(\/[[:alpha:]]\)\//\1:\//'`
fi
fi
# x86 or x86_64 should work for most cases
@@ -2,8 +2,14 @@
# generate a target definition pointing to the locally built p2 repo from the race-analysis-p2-remote target defintion
base="../definitions/race-analysis-p2"
remote_repo="http://p2.sapsailing.com/p2/sailing/"
local_repo="file://`readlink -f ../../com.sap.sailing.targetplatform.base/target/repository/ | sed -e 's/\/cygdrive\/\(.\)/\/\1:/'`"
remote_repo="https://p2.sapsailing.com/p2/sailing/"
#reading the filepath and editing it, so it fits for eclipse #currently save works for cygwin, gitbash and linux
local_repo="file://`readlink -f ../../com.sap.sailing.targetplatform.base/target/repository/`"
if [ "$OSTYPE" == "cygwin" ]; then
localRepo="file:`readlink -f ../../com.sap.sailing.targetplatform.base/target/repository/ | sed 's/^\/cygdrive\/\(.\)/\/\1:/'`"
fi
if [ "$OSTYPE" == "msys" ]; then
localRepo="file:`readlink -f ../../com.sap.sailing.targetplatform.base/target/repository/ | sed 's/^\(\/[[:alpha:]]\)\//\1:\//'`"
fi
# replace remote p2-repo URL with local repo URL
sed -e "/^<repository location=\"/ s@$remote_repo@$local_repo@" -e 's/target name="Race Analysis Target"/target name="Race Analysis Local Target"/' $base-remote.target > $base-local.target