forked from twrecked/hass-momentary
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall
More file actions
executable file
·31 lines (26 loc) · 708 Bytes
/
install
File metadata and controls
executable file
·31 lines (26 loc) · 708 Bytes
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
#!/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
${ECHO} mkdir -p "${DEST}/custom_components"
if [[ -n $(command -v fd) ]]; then
fd -e py -e json . custom_components --exec ${ECHO} cp -vf --parents {} "${DEST}" ;
else
${ECHO} cp -afv custom_components/momentary "${DEST}/custom_components"
fi
echo -- finished at "$(date '+%A at %H:%M:%S')"