Skip to content

Commit b252b7c

Browse files
committed
Fix copy after compilation
1 parent 6e5ea45 commit b252b7c

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

tools/config_editor/app.py

+13-4
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,8 @@ def arduino_default_path():
141141
else: # Windows and MacOS
142142
return os.path.join(home, "Documents", "Arduino", "hardware", "espressif", "esp32")
143143

144-
def check_arduino_path():
145-
return os.path.isdir(arduino_default_path())
144+
def check_arduino_path(path):
145+
return os.path.isdir(path)
146146

147147
def main() -> None:
148148
# Set the PYTHONUNBUFFERED environment variable to "1" to disable the output buffering
@@ -187,7 +187,7 @@ def main() -> None:
187187
parser.add_argument("--copy",
188188
type=bool,
189189
action=argparse.BooleanOptionalAction,
190-
default=True if check_arduino_path() else False,
190+
default=True,
191191
required=False,
192192
help="Enable/disable copying the compiled libraries to arduino-esp32. Enabled by default")
193193

@@ -238,7 +238,16 @@ def main() -> None:
238238

239239
app.supported_targets = [x[0] for x in target_choices]
240240
app.setting_target = args.target
241-
app.setting_enable_copy = args.copy
241+
242+
if args.copy:
243+
if check_arduino_path(args.arduino_path):
244+
app.setting_enable_copy = True
245+
else:
246+
print("Invalid path to Arduino core: " + os.path.abspath(args.arduino_path))
247+
exit(1)
248+
else:
249+
app.setting_enable_copy = False
250+
242251
app.setting_arduino_path = os.path.abspath(args.arduino_path)
243252
app.setting_arduino_branch = args.arduino_branch
244253
app.setting_idf_branch = args.idf_branch

0 commit comments

Comments
 (0)