Add OS detection; surface version in header; centralise pip installs

lib/common.sh:
  - detect_os(): reads /etc/os-release into OS_DISTRO, OS_VERSION,
    OS_CODENAME globals (exported, auto-called on source)
  - ubuntu_version_ge(): numeric version comparison helper
  - pip_user_install(): central wrapper for pip3 install --user so any
    future version-specific flags are in one place

setup.sh:
  - Both header banners now show detected OS line (e.g., "Ubuntu 24.04 (noble)")
  - First-run path warns if not Ubuntu or < 24.04

services/sky-cam.sh, services/sync-cc.sh:
  - Replace inline pip3 invocations with pip_user_install helper

https://claude.ai/code/session_01Y4dMKtkqkpvmgDKoRdzhTG
This commit is contained in:
Claude
2026-06-03 23:49:51 +00:00
parent 370c513606
commit ef08fef540
4 changed files with 47 additions and 7 deletions
+1 -2
View File
@@ -43,8 +43,7 @@ install_sky-cam() {
# ── Python packages ──────────────────────────────────────────────────────
log_info "Installing Python packages..."
local PIP="pip3 install --user --quiet"
sudo -u "$ACTUAL_USER" $PIP suntime pytz requests skyfield Pillow numpy scipy \
pip_user_install suntime pytz requests skyfield Pillow numpy scipy \
|| log_warning "Some pip packages may have failed — check output above"
log_success "Python packages installed"