@@ -141,8 +141,8 @@ def arduino_default_path():
141
141
else : # Windows and MacOS
142
142
return os .path .join (home , "Documents" , "Arduino" , "hardware" , "espressif" , "esp32" )
143
143
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 )
146
146
147
147
def main () -> None :
148
148
# Set the PYTHONUNBUFFERED environment variable to "1" to disable the output buffering
@@ -187,7 +187,7 @@ def main() -> None:
187
187
parser .add_argument ("--copy" ,
188
188
type = bool ,
189
189
action = argparse .BooleanOptionalAction ,
190
- default = True if check_arduino_path () else False ,
190
+ default = True ,
191
191
required = False ,
192
192
help = "Enable/disable copying the compiled libraries to arduino-esp32. Enabled by default" )
193
193
@@ -238,7 +238,16 @@ def main() -> None:
238
238
239
239
app .supported_targets = [x [0 ] for x in target_choices ]
240
240
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
+
242
251
app .setting_arduino_path = os .path .abspath (args .arduino_path )
243
252
app .setting_arduino_branch = args .arduino_branch
244
253
app .setting_idf_branch = args .idf_branch
0 commit comments