Resolve adb path in restore script; trim header

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Krzysztof Rudnicki 2026-11-21 00:22:24 +01:00
parent 1cbb310ff7
commit 9b50d95386
2 changed files with 7 additions and 3 deletions

View File

@ -24,6 +24,7 @@ import datetime as dt
import json import json
import os import os
from pathlib import Path from pathlib import Path
import shutil
import subprocess import subprocess
import sys import sys
import tempfile import tempfile
@ -60,8 +61,12 @@ def prepare_restore(export: dict[str, Any], now: dt.datetime) -> dict[str, Any]:
def _adb(*args: str) -> subprocess.CompletedProcess[str]: def _adb(*args: str) -> subprocess.CompletedProcess[str]:
serial = os.environ.get("ADB_SERIAL", "23181JEGR08034") serial = os.environ.get("ADB_SERIAL", "23181JEGR08034")
adb = shutil.which("adb")
if adb is None:
msg = "adb is not on PATH (sudo pacman -S android-tools)"
raise FileNotFoundError(msg)
return subprocess.run( return subprocess.run(
["adb", "-s", serial, *args], [adb, "-s", serial, *args],
check=True, check=True,
capture_output=True, capture_output=True,
text=True, text=True,

View File

@ -24,8 +24,7 @@ import 'package:workout_app/services/manual_workout_port.dart';
import 'package:workout_app/services/pace_target_store.dart'; import 'package:workout_app/services/pace_target_store.dart';
import 'package:workout_app/services/progression_sync_service.dart'; import 'package:workout_app/services/progression_sync_service.dart';
// Re-exported: ExerciseState was defined here until it moved to models/, and // Re-exported: callers reach ExerciseState etc. through this import.
// every caller still reaches it through this import.
export 'package:workout_app/models/exercise_state.dart'; export 'package:workout_app/models/exercise_state.dart';
export 'package:workout_app/models/manual_deload.dart'; export 'package:workout_app/models/manual_deload.dart';
export 'package:workout_app/models/progression.dart'; export 'package:workout_app/models/progression.dart';