mirror of
https://github.com/esphome/esphome.git
synced 2024-12-22 13:34:54 +01:00
Added "ESPHOME_NOGITIGNORE" env var to prevent .gitignore creation; moved env vars to consts (#1425)
This commit is contained in:
parent
498b59e998
commit
ac15ce576b
3 changed files with 10 additions and 5 deletions
|
@ -573,6 +573,9 @@ CONF_WIND_SPEED = 'wind_speed'
|
||||||
CONF_WINDOW_SIZE = 'window_size'
|
CONF_WINDOW_SIZE = 'window_size'
|
||||||
CONF_ZERO = 'zero'
|
CONF_ZERO = 'zero'
|
||||||
|
|
||||||
|
ENV_NOGITIGNORE = 'ESPHOME_NOGITIGNORE'
|
||||||
|
ENV_QUICKWIZARD = 'ESPHOME_QUICKWIZARD'
|
||||||
|
|
||||||
ICON_ACCELERATION = 'mdi:axis-arrow'
|
ICON_ACCELERATION = 'mdi:axis-arrow'
|
||||||
ICON_ACCELERATION_X = 'mdi:axis-x-arrow'
|
ICON_ACCELERATION_X = 'mdi:axis-x-arrow'
|
||||||
ICON_ACCELERATION_Y = 'mdi:axis-y-arrow'
|
ICON_ACCELERATION_Y = 'mdi:axis-y-arrow'
|
||||||
|
|
|
@ -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.pins import ESP32_BOARD_PINS, ESP8266_BOARD_PINS
|
||||||
from esphome.storage_json import StorageJSON, ext_storage_path
|
from esphome.storage_json import StorageJSON, ext_storage_path
|
||||||
from esphome.util import safe_print
|
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""" _____ ____ _____ ______
|
CORE_BIG = r""" _____ ____ _____ ______
|
||||||
/ ____/ __ \| __ \| ____|
|
/ ____/ __ \| __ \| ____|
|
||||||
|
@ -107,7 +107,7 @@ def wizard_write(path, **kwargs):
|
||||||
storage.save(storage_path)
|
storage.save(storage_path)
|
||||||
|
|
||||||
|
|
||||||
if get_bool_env('ESPHOME_QUICKWIZARD'):
|
if get_bool_env(ENV_QUICKWIZARD):
|
||||||
def sleep(time):
|
def sleep(time):
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -4,10 +4,11 @@ import re
|
||||||
|
|
||||||
from esphome.config import iter_components
|
from esphome.config import iter_components
|
||||||
from esphome.const import CONF_BOARD_FLASH_MODE, CONF_ESPHOME, CONF_PLATFORMIO_OPTIONS, \
|
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.core import CORE, EsphomeError
|
||||||
from esphome.helpers import mkdir_p, read_file, write_file_if_changed, walk_files, \
|
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.storage_json import StorageJSON, storage_path
|
||||||
from esphome.pins import ESP8266_FLASH_SIZES, ESP8266_LD_SCRIPTS
|
from esphome.pins import ESP8266_FLASH_SIZES, ESP8266_LD_SCRIPTS
|
||||||
|
|
||||||
|
@ -284,7 +285,8 @@ def write_platformio_project():
|
||||||
mkdir_p(CORE.build_path)
|
mkdir_p(CORE.build_path)
|
||||||
|
|
||||||
content = get_ini_content()
|
content = get_ini_content()
|
||||||
write_gitignore()
|
if not get_bool_env(ENV_NOGITIGNORE):
|
||||||
|
write_gitignore()
|
||||||
write_platformio_ini(content)
|
write_platformio_ini(content)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue