mirror of
https://github.com/esphome/esphome.git
synced 2024-11-10 01:07:45 +01:00
18 lines
560 B
Bash
Executable file
18 lines
560 B
Bash
Executable file
#!/bin/bash
|
|
|
|
# If /cache is mounted, use that as PIO's coredir
|
|
# otherwise use path in /config (so that PIO packages aren't downloaded on each compile)
|
|
|
|
if [[ -d /cache ]]; then
|
|
export PLATFORMIO_CORE_DIR=/cache/platformio
|
|
else
|
|
export PLATFORMIO_CORE_DIR=/config/.esphome/platformio
|
|
fi
|
|
|
|
if [[ ! -d "${PLATFORMIO_CORE_DIR}" ]]; then
|
|
echo "Creating cache directory ${PLATFORMIO_CORE_DIR}"
|
|
echo "You can change this behavior by mounting a directory to the container's /cache directory."
|
|
mkdir -p "${PLATFORMIO_CORE_DIR}"
|
|
fi
|
|
|
|
exec esphome "$@"
|