Skip to content

Debloat any Android or Google TV over Wi-Fi and get an Apple TV-style home.

tools: Git Bash hands Windows Python a Windows path in four install scripts

Rasmus Kjær Damgaard15e25a4023d3
diff --git a/addons/photo-screensaver/build-and-install.sh b/addons/photo-screensaver/build-and-install.sh
index 659a44d3e..3952252f8 100755
--- a/addons/photo-screensaver/build-and-install.sh
+++ b/addons/photo-screensaver/build-and-install.sh
@@ -5,7 +5,7 @@
# Usage: TV_HOST=192.168.1.50 addons/photo-screensaver/build-and-install.sh
# TV_HOST=192.168.1.50 addons/photo-screensaver/build-and-install.sh --uninstall
set -euo pipefail
-HERE="$(cd "$(dirname "$0")" && pwd)"
+HERE="$(cd "$(dirname "$0")" && (pwd -W 2>/dev/null || pwd))"
TOOLS="$HERE/../../tools"
: "${TV_HOST:?set TV_HOST to the TV IP address, e.g. TV_HOST=192.168.1.50 $0}"
PY="$TOOLS/venv/bin/python"
diff --git a/addons/sleep-timer/build-and-install.sh b/addons/sleep-timer/build-and-install.sh
index c653b37a3..081c96024 100755
--- a/addons/sleep-timer/build-and-install.sh
+++ b/addons/sleep-timer/build-and-install.sh
@@ -7,7 +7,7 @@
# Try it without waiting (adb only): a 70 s timer, the warning after 10 s:
# TV_HOST=192.168.1.50 tools/tv.py 'am broadcast -n io.github.luyzfernando08.sleeptimer/.AlarmReceiver -a io.github.luyzfernando08.sleeptimer.TEST --ei seconds 70'
set -euo pipefail
-HERE="$(cd "$(dirname "$0")" && pwd)"
+HERE="$(cd "$(dirname "$0")" && (pwd -W 2>/dev/null || pwd))"
TOOLS="$HERE/../../tools"
: "${TV_HOST:?set TV_HOST to the TV IP address, e.g. TV_HOST=192.168.1.50 $0}"
PY="$TOOLS/venv/bin/python"
diff --git a/addons/tv-static/build-and-install.sh b/addons/tv-static/build-and-install.sh
index c0b71ce81..bc98f148d 100755
--- a/addons/tv-static/build-and-install.sh
+++ b/addons/tv-static/build-and-install.sh
@@ -6,7 +6,7 @@
# TV_HOST=192.168.1.50 addons/tv-static/build-and-install.sh --no-play # install without playing it now
# TV_HOST=192.168.1.50 addons/tv-static/build-and-install.sh --uninstall
set -euo pipefail
-HERE="$(cd "$(dirname "$0")" && pwd)"
+HERE="$(cd "$(dirname "$0")" && (pwd -W 2>/dev/null || pwd))"
TOOLS="$HERE/../../tools"
: "${TV_HOST:?set TV_HOST to the TV IP address, e.g. TV_HOST=192.168.1.50 $0}"
PY="$TOOLS/venv/bin/python"
diff --git a/launcher/build-and-install.sh b/launcher/build-and-install.sh
index f5d5a448e..cec3148fd 100755
--- a/launcher/build-and-install.sh
+++ b/launcher/build-and-install.sh
@@ -3,7 +3,7 @@
set -euo pipefail
cd "$(dirname "$0")"
: "${TV_HOST:?set TV_HOST to the TV IP address, e.g. TV_HOST=192.168.1.50 $0}"
-TOOLS="$(cd ../tools && pwd)" # absolute, so the venv's Python doesn't warn about "../" in its prefix
+TOOLS="$(cd ../tools && (pwd -W 2>/dev/null || pwd))" # absolute (Windows form on Git Bash, for Windows Python), so the venv's Python doesn't warn about "../" in its prefix
PY=$TOOLS/venv/bin/python
[ -x "$PY" ] || PY=$TOOLS/venv/Scripts/python.exe
# No venv yet: say how to make one (as tools/disable.sh does) instead of failing on the Windows path (#1142).