forked from beacon3d/beacon_klipper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·28 lines (22 loc) · 873 Bytes
/
install.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
#!/bin/bash
KDIR="${HOME}/klipper"
KENV="${HOME}/klippy-env"
BKDIR="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
if [ ! -d "$KDIR" ] || [ ! -d "$KENV" ]; then
echo "beacon: klipper or klippy env doesn't exist"
exit 1
fi
# install beacon requirements to env
echo "beacon: installing python requirements to env, this may take 10+ minutes."
"${KENV}/bin/pip" install -r "${BKDIR}/requirements.txt"
# update link to beacon.py
echo "beacon: linking klippy to beacon.py."
if [ -e "${KDIR}/klippy/extras/beacon.py" ]; then
rm "${KDIR}/klippy/extras/beacon.py"
fi
ln -s "${BKDIR}/beacon.py" "${KDIR}/klippy/extras/beacon.py"
# exclude beacon.py from klipper git tracking
if ! grep -q "klippy/extras/beacon.py" "${KDIR}/.git/info/exclude"; then
echo "klippy/extras/beacon.py" >> "${KDIR}/.git/info/exclude"
fi
echo "beacon: installation successful."