public-ai-sync 0.0.79 → 0.0.81
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/install-public-ai.sh +27 -0
- package/package.json +1 -1
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
|
|
4
|
+
fail_missing() {
|
|
5
|
+
printf 'public-ai-install: missing %s\n' "$1" >&2
|
|
6
|
+
exit 1
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
consumer_root() {
|
|
10
|
+
if [ "${1:-}" != "" ]; then
|
|
11
|
+
printf '%s\n' "$1"
|
|
12
|
+
return
|
|
13
|
+
fi
|
|
14
|
+
if [ "${PUBLIC_AI_SYNC_ROOT:-}" != "" ]; then
|
|
15
|
+
printf '%s\n' "$PUBLIC_AI_SYNC_ROOT"
|
|
16
|
+
return
|
|
17
|
+
fi
|
|
18
|
+
pwd
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
here="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
22
|
+
sync="$here/sync.mjs"
|
|
23
|
+
command -v node >/dev/null 2>&1 || fail_missing node
|
|
24
|
+
[ -f "$sync" ] || fail_missing sync.mjs
|
|
25
|
+
PUBLIC_AI_SYNC_ROOT="$(consumer_root "${1:-}")"
|
|
26
|
+
export PUBLIC_AI_SYNC_ROOT
|
|
27
|
+
exec node "$sync"
|