-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathupvendor.sh
executable file
·44 lines (34 loc) · 978 Bytes
/
upvendor.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/bash
set -e
# Enumerate the vendors in this file
VENDORS=('polyverse')
# polyverse commitshas
POLYVERSE_READHOOK_VER="v1.3.0-alpha"
function main() {
VENDOR_ROOT="${PWD}/vendor"
# Delete the whole vendor folder and make a clean one
rm -rf ${VENDOR_ROOT} && mkdir -p "${VENDOR_ROOT}"
# Upvendor each of the listed vendors
for VENDOR in ${VENDORS[@]}; do
upvendor $VENDOR
done
return 0
}
function upvendor() {
VENDOR_FOLDER="${VENDOR_ROOT}/$1"
mkdir -p "${VENDOR_FOLDER}"
echo "INFO: Upvendoring: $1"
cd ${VENDOR_FOLDER}
$1
}
function polyverse() {
if [[ -n "$PV_UPVENDOR_LOCAL" ]]; then # (Convenience for development)
cp -v ../../../readhook/dll/basehook.so .
cp -v ../../../readhook/dll/fullhook.so .
else
wget -nv https://github.com/polyverse/readhook/releases/download/${POLYVERSE_READHOOK_VER}/basehook.so
wget -nv https://github.com/polyverse/readhook/releases/download/${POLYVERSE_READHOOK_VER}/fullhook.so
fi
}
main "$@"
exit $?