mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-11-08 20:12:23 +00:00
17 lines
458 B
Bash
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
|
|
} |