Files
self-healing-autopoietic-shell/contrib/fx/sources.d/90-team-shared.sh
T

16 lines
699 B
Bash
Raw Normal View History

#!/bin/sh
# EXAMPLE custom source -- a template, not a real dependency. This is
# the entire extension mechanism demonstrated: any executable dropped
# into sources.d/ following the contract in fx.sh is picked up
# automatically, no registration step anywhere else.
#
# Pulls a team-shared p-format corrections file and offers exact-key
# matches. Off by default (no-ops unless FX_TEAM_URL is set) because a
# match here becomes eval'd code the moment you select it -- point this
# at a URL you trust the same way you'd trust an rc file, never a
# random link.
[ -n "$FX_TEAM_URL" ] || exit 0
cmd="$1"
[ -n "$cmd" ] || exit 0
curl -fsSL "$FX_TEAM_URL" 2>/dev/null | grep -F "${cmd}=" | cut -d= -f2-