#!/usr/bin/env bash # shellcheck source=../../shared/hooks/scripts/resolve-python.sh . "$(dirname -- "${BASH_SOURCE[0]}")/../../shared/hooks/scripts/resolve-python.sh" resolve_python || true sync_qmd() { local root=$1 client=$2 home_path=$3 enabled=$4 dry_run=$5 update=$6 summary=${7:-false} local arguments=("$root/scripts/lib/qmd.py" sync --root "$root" --home "$home_path" --client "$client" --enabled "$enabled") [ "$dry_run" != true ] || arguments+=(--dry-run) [ "$update" != true ] || arguments+=(--update) [ "$summary" != true ] || arguments+=(--summary) run_python "${arguments[@]}" } test_qmd_device() { local root=$1 home_path=$2 summary=${3:-false} local arguments=("$root/scripts/lib/qmd.py" benchmark --root "$root" --home "$home_path") [ "$summary" != true ] || arguments+=(--summary) local status if run_python "${arguments[@]}" >&2; then return 0; else status=$?; fi [ "$status" -eq 2 ] && return 1 return 2 }