Added "ESPHOME_NOGITIGNORE" env var to prevent .gitignore creation; moved env vars to consts (#1425)

This commit is contained in:
acshef 2020-12-21 15:19:26 -06:00 committed by GitHub
parent 498b59e998
commit ac15ce576b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 5 deletions

View file

@ -573,6 +573,9 @@ CONF_WIND_SPEED = 'wind_speed'
CONF_WINDOW_SIZE = 'window_size'
CONF_ZERO = 'zero'
ENV_NOGITIGNORE = 'ESPHOME_NOGITIGNORE'
ENV_QUICKWIZARD = 'ESPHOME_QUICKWIZARD'
ICON_ACCELERATION = 'mdi:axis-arrow'
ICON_ACCELERATION_X = 'mdi:axis-x-arrow'
ICON_ACCELERATION_Y = 'mdi:axis-y-arrow'

View file

@ -11,7 +11,7 @@ from esphome.helpers import color, get_bool_env, write_file
from esphome.pins import ESP32_BOARD_PINS, ESP8266_BOARD_PINS
from esphome.storage_json import StorageJSON, ext_storage_path
from esphome.util import safe_print
from esphome.const import ALLOWED_NAME_CHARS
from esphome.const import ALLOWED_NAME_CHARS, ENV_QUICKWIZARD
CORE_BIG = r""" _____ ____ _____ ______
/ ____/ __ \| __ \| ____|
@ -107,7 +107,7 @@ def wizard_write(path, **kwargs):
storage.save(storage_path)
if get_bool_env('ESPHOME_QUICKWIZARD'):
if get_bool_env(ENV_QUICKWIZARD):
def sleep(time):
pass
else:

View file

@ -4,10 +4,11 @@ import re
from esphome.config import iter_components
from esphome.const import CONF_BOARD_FLASH_MODE, CONF_ESPHOME, CONF_PLATFORMIO_OPTIONS, \
HEADER_FILE_EXTENSIONS, SOURCE_FILE_EXTENSIONS, __version__, ARDUINO_VERSION_ESP8266
HEADER_FILE_EXTENSIONS, SOURCE_FILE_EXTENSIONS, __version__, ARDUINO_VERSION_ESP8266, \
ENV_NOGITIGNORE
from esphome.core import CORE, EsphomeError
from esphome.helpers import mkdir_p, read_file, write_file_if_changed, walk_files, \
copy_file_if_changed
copy_file_if_changed, get_bool_env
from esphome.storage_json import StorageJSON, storage_path
from esphome.pins import ESP8266_FLASH_SIZES, ESP8266_LD_SCRIPTS
@ -284,6 +285,7 @@ def write_platformio_project():
mkdir_p(CORE.build_path)
content = get_ini_content()
if not get_bool_env(ENV_NOGITIGNORE):
write_gitignore()
write_platformio_ini(content)