init.sh 614 B

12345678910111213
  1. {% macro init(values) -%}
  2. #!/bin/sh
  3. set -e
  4. echo "Checking if directory [{{ values.consts.init_config_path }}] is empty (Mounted at [{{ values.consts.dashy_config_path }}] when app is running)"
  5. if [ -z "$(ls -A {{ values.consts.init_config_path }})" ]; then
  6. echo "Directory [{{ values.consts.init_config_path }}] is empty, copying from defaults located at [{{ values.consts.dashy_config_path }}] in the container"
  7. cp -r {{ values.consts.dashy_config_path }}/* {{ values.consts.init_config_path }}
  8. exit 0
  9. fi
  10. echo "Directory [{{ values.consts.init_config_path }}] is not empty, skipping copy"
  11. {%- endmacro %}