diff --git a/builder b/builder index 21a7889..987ca31 100644 --- a/builder +++ b/builder @@ -38,17 +38,28 @@ function steamlib_by_steamid () # $1: SteamID { local Path + if ! [[ -f "$SteamLibFoldersVdf" ]]; then + return + fi + while read -r Line do if echo "$Line" | grep -Foq '"path"'; then Path="$(echo "$Line" | sed -r 's|^\s*\"path\"\s*||' | sed 's|"||g')" fi if echo "$Line" | grep -Poq "^\s*\"${1}\"\s*\"\d+\"$"; then - cygpath --unix "$Path" + wrapped_cygpath --unix "$Path" fi done < "$SteamLibFoldersVdf" } +function wrapped_cygpath () # $@: Params +{ + if [[ "$OSTYPE" == "msys" || "$OSTYPE" == "cygwin" ]]; then + cygpath "$@" + fi +} + # Whoami ScriptFullname="$(readlink -e "$0")" ScriptName="$(basename "$0")" @@ -56,7 +67,7 @@ ScriptDir="$(dirname "$ScriptFullname")" # Common SteamPath="$(reg_readkey "HKCU\Software\Valve\Steam" "SteamPath")" -DocumentsPath="$(cygpath --mydocs)" +DocumentsPath="$(wrapped_cygpath --mydocs)" ThirdPartyBin="$ScriptDir/3rd-party-bin" DummyPreview="$ScriptDir/dummy_preview.png" SteamLibFoldersVdf="$SteamPath/steamapps/libraryfolders.vdf"