mirror of
https://github.com/domfelipe/agentpack-lite.git
synced 2026-08-07 05:56:42 +00:00
feat: complete operational growth foundations
This commit is contained in:
commit
8ec85e51f8
5 changed files with 154 additions and 0 deletions
44
install.sh
Executable file
44
install.sh
Executable file
|
|
@ -0,0 +1,44 @@
|
|||
#!/bin/sh
|
||||
set -eu
|
||||
|
||||
SOURCE_URL="${AGENTPACK_LITE_URL:-https://agentpacks.domhubs.com.br/api/lite/agents}"
|
||||
EXPECTED_SHA256="03d2b7d8258ca271bf84f3afa9e72dfde7accdf55b1f800ffca9a84976e59b79"
|
||||
DESTINATION="${AGENTPACK_TARGET:-AGENTS.md}"
|
||||
DRY_RUN=0
|
||||
|
||||
if [ "${1:-}" = "--dry-run" ]; then
|
||||
DRY_RUN=1
|
||||
fi
|
||||
|
||||
if [ -e "$DESTINATION" ]; then
|
||||
echo "Arquivo existente; nada foi sobrescrito: $DESTINATION" >&2
|
||||
exit 2
|
||||
fi
|
||||
|
||||
tmp="$(mktemp "${TMPDIR:-/tmp}/agentpack-lite.XXXXXX")"
|
||||
cleanup() { rm -f "$tmp"; }
|
||||
trap cleanup EXIT INT TERM
|
||||
|
||||
if command -v curl >/dev/null 2>&1; then
|
||||
curl --fail --silent --show-error --location "$SOURCE_URL" --output "$tmp"
|
||||
elif command -v fetch >/dev/null 2>&1; then
|
||||
fetch -o "$tmp" "$SOURCE_URL"
|
||||
else
|
||||
echo "É necessário curl ou fetch para baixar o AgentPack Lite." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
actual="$(shasum -a 256 "$tmp" | awk '{print $1}')"
|
||||
if [ "$actual" != "$EXPECTED_SHA256" ]; then
|
||||
echo "Falha de integridade: SHA-256 inesperado ($actual)." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ "$DRY_RUN" -eq 1 ]; then
|
||||
echo "OK: instalaria $DESTINATION (SHA-256 $actual)"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
umask 022
|
||||
cp "$tmp" "$DESTINATION"
|
||||
echo "AgentPack Lite instalado em $DESTINATION"
|
||||
Loading…
Add table
Add a link
Reference in a new issue