hide cygpath from unix systems
This commit is contained in:
parent
cb4f8730ec
commit
c34ffcbe76
15
builder
15
builder
@ -38,17 +38,28 @@ function steamlib_by_steamid () # $1: SteamID
|
|||||||
{
|
{
|
||||||
local Path
|
local Path
|
||||||
|
|
||||||
|
if ! [[ -f "$SteamLibFoldersVdf" ]]; then
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
while read -r Line
|
while read -r Line
|
||||||
do
|
do
|
||||||
if echo "$Line" | grep -Foq '"path"'; then
|
if echo "$Line" | grep -Foq '"path"'; then
|
||||||
Path="$(echo "$Line" | sed -r 's|^\s*\"path\"\s*||' | sed 's|"||g')"
|
Path="$(echo "$Line" | sed -r 's|^\s*\"path\"\s*||' | sed 's|"||g')"
|
||||||
fi
|
fi
|
||||||
if echo "$Line" | grep -Poq "^\s*\"${1}\"\s*\"\d+\"$"; then
|
if echo "$Line" | grep -Poq "^\s*\"${1}\"\s*\"\d+\"$"; then
|
||||||
cygpath --unix "$Path"
|
wrapped_cygpath --unix "$Path"
|
||||||
fi
|
fi
|
||||||
done < "$SteamLibFoldersVdf"
|
done < "$SteamLibFoldersVdf"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function wrapped_cygpath () # $@: Params
|
||||||
|
{
|
||||||
|
if [[ "$OSTYPE" == "msys" || "$OSTYPE" == "cygwin" ]]; then
|
||||||
|
cygpath "$@"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
# Whoami
|
# Whoami
|
||||||
ScriptFullname="$(readlink -e "$0")"
|
ScriptFullname="$(readlink -e "$0")"
|
||||||
ScriptName="$(basename "$0")"
|
ScriptName="$(basename "$0")"
|
||||||
@ -56,7 +67,7 @@ ScriptDir="$(dirname "$ScriptFullname")"
|
|||||||
|
|
||||||
# Common
|
# Common
|
||||||
SteamPath="$(reg_readkey "HKCU\Software\Valve\Steam" "SteamPath")"
|
SteamPath="$(reg_readkey "HKCU\Software\Valve\Steam" "SteamPath")"
|
||||||
DocumentsPath="$(cygpath --mydocs)"
|
DocumentsPath="$(wrapped_cygpath --mydocs)"
|
||||||
ThirdPartyBin="$ScriptDir/3rd-party-bin"
|
ThirdPartyBin="$ScriptDir/3rd-party-bin"
|
||||||
DummyPreview="$ScriptDir/dummy_preview.png"
|
DummyPreview="$ScriptDir/dummy_preview.png"
|
||||||
SteamLibFoldersVdf="$SteamPath/steamapps/libraryfolders.vdf"
|
SteamLibFoldersVdf="$SteamPath/steamapps/libraryfolders.vdf"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user