Files
potatium/scripts/doctor.sh
T

33 lines
1.4 KiB
Bash
Executable File

#!/usr/bin/env bash
# Non-destructive checks. Run from unpacked Potatium repository as normal user.
set -Eeuo pipefail
ROOT=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." && pwd)
cd "$ROOT"
printf '=== Potatium development environment ===\n'
if [[ -r /etc/os-release ]]; then
# shellcheck disable=SC1091
. /etc/os-release
echo "OS: ${PRETTY_NAME:-unknown}"
[[ "${ID:-}" == ubuntu && "${VERSION_ID:-}" == '26.04' ]] || echo 'WARN: Expected Ubuntu 26.04 LTS.'
fi
printf 'User: %s\nProject: %s\n' "$(id -un)" "$ROOT"
for p in go git bash curl; do
if ! command -v "$p" >/dev/null 2>&1; then echo "MISSING: $p" >&2; exit 1; fi
done
go version
git --version
if [[ -d .git ]]; then git status --short; else echo 'NOTE: Git repo not initialized yet (normal before git init).'; fi
echo '=== Shell syntax ==='
for f in scripts/*.sh; do bash -n "$f"; done
echo 'OK: shell syntax'
echo '=== Go formatting ==='
UNFORMATTED=$(gofmt -l cmd internal 2>/dev/null || true)
if [[ -n "$UNFORMATTED" ]]; then echo "Go files not gofmt-clean:"; echo "$UNFORMATTED"; exit 1; fi
printf 'OK: gofmt\n=== Go tests ===\n'
go test ./...
printf '=== Go vet ===\n'
go vet ./...
printf '=== Web wallet scaffold ===\n'
test -s web/wallet/index.html && echo 'OK: web/wallet/index.html exists (static preview only)'
printf '\nSUCCESS: development scaffold checks passed; blockchain/wallet NOT implemented.\n'