mirror of
				https://github.com/luc-github/ESP3D.git
				synced 2025-10-24 11:50:52 -07:00 
			
		
		
		
	Update extra_script.py
allow variable space in define line for the library need checking
This commit is contained in:
		| @@ -8,8 +8,10 @@ configuration_file = join(ROOT_DIR, "esp3d", "configuration.h") | |||||||
| print("Check if need to add some library to path") | print("Check if need to add some library to path") | ||||||
| if isfile(configuration_file): | if isfile(configuration_file): | ||||||
|     fh = open(configuration_file, 'r') |     fh = open(configuration_file, 'r') | ||||||
|  |     entry = None | ||||||
|     for line in fh: |     for line in fh: | ||||||
|         entry = re.search('^#define(\s)*SD_DEVICE(\s)*ESP_SDFAT2', line) |         pattern =r'^\s*#\s*define\s+SD_DEVICE\s+ESP_SDFAT2' | ||||||
|  |         entry = re.search(pattern, line) | ||||||
|         if entry: |         if entry: | ||||||
|             print("Need to add some SD FAT library to path") |             print("Need to add some SD FAT library to path") | ||||||
|             if (env["PIOPLATFORM"] == "espressif8266"): |             if (env["PIOPLATFORM"] == "espressif8266"): | ||||||
| @@ -26,7 +28,10 @@ if isfile(configuration_file): | |||||||
|             else: |             else: | ||||||
|                 print("Add SDFat2 library to path") |                 print("Add SDFat2 library to path") | ||||||
|                 env["LIBSOURCE_DIRS"].append("extra-libraries/ESP32") |                 env["LIBSOURCE_DIRS"].append("extra-libraries/ESP32") | ||||||
|  |             break | ||||||
|     fh.close() |     fh.close() | ||||||
|  |     if entry is None: | ||||||
|  |         print("No need to add any extra library") | ||||||
| else: | else: | ||||||
|     print("No configuration.h file found") |     print("No configuration.h file found") | ||||||
| print(env["LIBSOURCE_DIRS"]) | print(env["LIBSOURCE_DIRS"]) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user