-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdeleteEspAsyncWebServerSpiffs.py
More file actions
25 lines (22 loc) · 1.02 KB
/
deleteEspAsyncWebServerSpiffs.py
File metadata and controls
25 lines (22 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# This script deletes 3 obsolete files in ESPAsyncWebServer library
# It's run by (pre) extra_script command in platformio.ini
import os
import inspect
import pathlib
Import("env")
thisScriptFullFileName = inspect.getouterframes(inspect.currentframe())[0].filename
thisScriptFileName = pathlib.Path(thisScriptFullFileName).name
thisScriptPath = pathlib.Path(thisScriptFullFileName).parent.resolve()
LIBDEPS_DIR = env['PROJECT_LIBDEPS_DIR']
LIBRARY_NAME = 'ESP Async WebServer'
LIBRARY_FOLDER = 'src'
FILE_TO_DELETE_LIST = ['SPIFFSEditor.h','SPIFFSEditor.cpp','edit.htm']
# For each file to delete
for fileToDelete in FILE_TO_DELETE_LIST:
# For each folder in LIBDEPS_DIR (for the different targets)
for folder in os.listdir(LIBDEPS_DIR):
# Does file exist?
fullFileName = os.path.join(LIBDEPS_DIR, folder, LIBRARY_NAME, LIBRARY_FOLDER, fileToDelete)
if os.path.isfile(fullFileName):
print(F'{thisScriptFileName}: Deleting {fullFileName}')
os.remove(fullFileName)