Files
sailing-analytics/configuration/correctFilePathInRelationToCurrentOs.sh
T
2018-09-06 10:49:12 +02:00

17 lines
458 B
Bash

#!/bin/bash
#editing the filepath, so it fits for operating system #currently savely works for cygwin, gitbash and linux
correct_file_path()
{
if [[ "$1" == '/' ]] || [[ "$1" == "" ]]; then
echo ""
return 0
fi
if [ "$OSTYPE" == "cygwin" ]; then
echo $1 | sed 's/^\/cygdrive\/\([a-zA-Z]\)\//\1:\//'
elif [ "$OSTYPE" == "msys" ]; then
echo $1 | sed 's/^\/\([a-zA-Z]\)\//\1:\//'
else
echo $1
fi
}