mirror of
https://github.com/esphome/esphome.git
synced 2024-12-19 16:07:47 +01:00
19 lines
560 B
Bash
Executable File
19 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 "$@"
|