#!/bin/sh if [ -z "$_ROKU_SHELL_DIR" ]; then _ROKU_SHELL_DIR=$(dirname $(realpath $(readlink -f "${BASH_SOURCE[0]}" ))) fi _ROKU_SHELL=$_ROKU_SHELL_DIR/_roku.sh export DEVPASSWORD=aaaa _roku_device() { if [ "$1" != "" ]; then export ROKU_DEV_TARGET="$1" export ROKU_DEV_PLATFORM="$($_ROKU_SHELL device_platform)" fi echo "device: $ROKU_DEV_TARGET" echo "platform: $ROKU_DEV_PLATFORM" } _roku_wget_pass() { echo "Set ROKU_CORP_PASSWORD:" read -sr ROKU_CORP_PASSWORD export ROKU_CORP_PASSWORD } _ROKU_DEFAULT_DISPATCH_FUNC=$_ROKU_SHELL _roku_dispatch() { local DISPATCH_FUNC=$_ROKU_DEFAULT_DISPATCH_FUNC if [ "$(type -t _roku_$1_$2)" == "function" ]; then DISPATCH_FUNC=_roku_$1_$2 shift shift elif [ "$(type -t _roku_$1)" == "function" ]; then DISPATCH_FUNC=_roku_$1 shift fi $DISPATCH_FUNC "$@" } roku() { _roku_dispatch "$@" }