From b15392b5f260123e75cf5606b7d507838f1fb77d Mon Sep 17 00:00:00 2001 From: Yassine Gherbi Date: Wed, 23 Apr 2025 14:10:28 +0200 Subject: feat: VSCode Tasks Runner and deckdebug.sh Enhancements (#763) * feat: add dependency checks in deckdebug.sh * feat: add argument validation to deckdebug.sh * feat: remove unnecessary (testing) dependency from deckdebug.sh * . * feat: add script to run VSCode tasks with dependency handling * fix: update script usage instructions in tasks.sh * fix: dependency check after checking for nix * feat: add nix shell support in tasks.sh * fix: match the dependencies Resolve: https://github.com/SteamDeckHomebrew/decky-loader/pull/763/files/d22612c207b1f0996f2a1dbc4bd7ad392b12e49c#r2039722788 * fix incorrect path in usage --------- Co-authored-by: AAGaming --- scripts/deckdebug.sh | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) mode change 100644 => 100755 scripts/deckdebug.sh (limited to 'scripts/deckdebug.sh') diff --git a/scripts/deckdebug.sh b/scripts/deckdebug.sh old mode 100644 new mode 100755 index c6aa63bf..89d59e18 --- a/scripts/deckdebug.sh +++ b/scripts/deckdebug.sh @@ -2,6 +2,13 @@ # Usage: deckdebug.sh DECKIP:8081 # Dependencies: websocat jq curl chromium +if [ "$#" -ne 1 ]; then + echo "Error: Missing or incorrect argument." >&2 + echo "Usage: deckdebug.sh DECKIP:8081" >&2 + exit 1 +fi + + # https://jackson.dev/post/a-portable-nix-shell-shebang/ if [ -z "$INSIDE_NIX_RANDOMSTRING" ] && command -v nix &> /dev/null; then # If the user has nix, relaunch in nix shell with dependencies added @@ -13,6 +20,16 @@ if [ -z "$INSIDE_NIX_RANDOMSTRING" ] && command -v nix &> /dev/null; then exit $? fi +required_dependencies=(websocat jq curl chromium) + +# Check if the dependencies are installed +for cmd in "${required_dependencies[@]}"; do + if ! command -v "$cmd" &> /dev/null; then + echo "Error: '$cmd' is not installed. Please install it and try again." >&2 + exit 1 + fi +done + chromium --remote-debugging-port=9222 & sleep 2 @@ -41,4 +58,4 @@ while :; do fi sleep 5 -done \ No newline at end of file +done -- cgit v1.2.3