-
Notifications
You must be signed in to change notification settings - Fork 78
/
install
executable file
·43 lines (37 loc) · 1.06 KB
/
install
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
#!/bin/bash
#
if [[ "${1}" == "go" ]]; then
ECHO=
shift
else
ECHO=echo
fi
DEST="${1}"
if [[ -z "${DEST}" ]]; then
echo "*** please supply the home-assistant /config directory"
exit 1
fi
if [[ ! -d "${DEST}" ]]; then
echo "*** please make sure the destination directory exists"
exit 1
fi
if [[ -n "${ECHO}" ]]; then
echo "**** would run the following commands, use './install go $1' to do the work"
fi
if [[ -f "${DEST}/custom_components/sensor/aarlo.py" ]]; then
echo "****"
echo "**** it looks like you have aarlo files using an old layout, you should remove it first with, see how by running:"
echo "**** ./remove_old ${1}"
echo "****"
echo "****"
fi
#${ECHO} mkdir -p "${DEST}/www"
#${ECHO} cp -afv dist/hass-aarlo.js "${DEST}/www/aarlo-glance.js"
echo -- installing
${ECHO} mkdir -p "${DEST}/custom_components"
if [[ -n $(command -v fd) ]]; then
fd -e py . -e json -e yaml custom_components --exec ${ECHO} cp -vf --parents {} "${DEST}" ;
else
${ECHO} cp -afv custom_components/aarlo "${DEST}/custom_components"
fi
echo -- finished at "$(date '+%A at %H:%M:%S')"