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: d22612c207 (r2039722788)

* fix incorrect path in usage

---------

Co-authored-by: AAGaming <aagaming00@protonmail.com>
This commit is contained in:
Yassine Gherbi
2025-04-23 14:10:28 +02:00
committed by GitHub
parent e646168e31
commit b15392b5f2
3 changed files with 138 additions and 1 deletions

19
scripts/deckdebug.sh Normal file → Executable file
View File

@@ -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
done