2020-11-03 14:19:00 +00:00
|
|
|
#!/usr/bin/env python3
|
2017-04-19 20:32:18 +00:00
|
|
|
#
|
|
|
|
# Delete project files for all BTstack embedded examples in local port/esp32 folder
|
|
|
|
|
|
|
|
import os
|
|
|
|
import shutil
|
|
|
|
import sys
|
|
|
|
import time
|
|
|
|
import subprocess
|
|
|
|
|
|
|
|
# get script path
|
|
|
|
script_path = os.path.abspath(os.path.dirname(sys.argv[0]))
|
|
|
|
|
|
|
|
# path to examples
|
|
|
|
examples_embedded = script_path + "/../../example/"
|
|
|
|
|
|
|
|
# path to port/esp32
|
2017-09-25 19:35:38 +00:00
|
|
|
apps_btstack = script_path + "/"
|
2017-04-19 20:32:18 +00:00
|
|
|
|
2017-09-28 13:38:19 +00:00
|
|
|
print("Deleting example in local folder")
|
2017-04-19 20:32:18 +00:00
|
|
|
for file in os.listdir(examples_embedded):
|
|
|
|
if not file.endswith(".c"):
|
|
|
|
continue
|
|
|
|
example = file[:-2]
|
2020-12-24 15:55:36 +00:00
|
|
|
apps_folder = apps_btstack + "example/" + example + "/"
|
2017-04-19 20:32:18 +00:00
|
|
|
if os.path.exists(apps_folder):
|
|
|
|
shutil.rmtree(apps_folder)
|
|
|
|
print("- %s" % example)
|
|
|
|
|
2017-09-28 13:38:19 +00:00
|
|
|
print("Deleting example folder")
|
2020-12-24 15:55:36 +00:00
|
|
|
examples_folder = apps_btstack + "/example"
|
2017-09-25 19:35:38 +00:00
|
|
|
if os.path.exists(examples_folder):
|
|
|
|
shutil.rmtree(examples_folder)
|