infra/dev: env_value defaults match compose, die helper, shared Gradle lock check; drop unused RCLONE_REMOTE and M2a leftovers; fix stale Pi compose path
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TQd3pEP9UeN2uifbHknQ7B
This commit is contained in:
+6
-8
@@ -8,9 +8,13 @@ repo_root="$(cd "$dev_dir/../.." && pwd)"
|
||||
# infra/dev/.env (git-ignored) when it exists, otherwise the committed example.
|
||||
if [[ -f "$dev_dir/.env" ]]; then env_file="$dev_dir/.env"; else env_file="$dev_dir/.env.example"; fi
|
||||
|
||||
# Value of KEY in the env file (empty when unset or blank).
|
||||
die() { printf '%s: %s\n' "$(basename "$0")" "$*" >&2; exit 1; }
|
||||
|
||||
# Value of KEY in the env file; DEFAULT (the compose.yaml default, optional) when unset or blank.
|
||||
env_value() {
|
||||
sed -n "s/^$1=//p" "$env_file" | tail -n 1
|
||||
local v
|
||||
v="$(sed -n "s/^$1=//p" "$env_file" | tail -n 1)"
|
||||
printf '%s\n' "${v:-${2:-}}"
|
||||
}
|
||||
|
||||
compose() {
|
||||
@@ -31,9 +35,3 @@ lan_address() {
|
||||
iface="$(route -n get default 2>/dev/null | awk '/interface:/ {print $2}')"
|
||||
[[ -n "$iface" ]] && ipconfig getifaddr "$iface" 2>/dev/null
|
||||
}
|
||||
|
||||
dev_port() {
|
||||
local p
|
||||
p="$(env_value KVITT_DEV_PORT)"
|
||||
printf '%s\n' "${p:-8080}"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user