File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -98,6 +98,7 @@ def install_platform(platform):
9898 ColorPrint .print_pass (CHECK )
9999
100100def run_or_die (cmd , error ):
101+ print (cmd )
101102 if os .system (cmd ) != 0 :
102103 ColorPrint .print_fail (error )
103104 exit (- 1 )
@@ -121,9 +122,12 @@ def run_or_die(cmd, error):
121122os .symlink (BUILD_DIR , os .environ ['HOME' ]+ '/Arduino/libraries/Adafruit_Test_Library' )
122123
123124################################ Install dependancies
125+ our_name = None
124126try :
125127 libprop = open (BUILD_DIR + '/library.properties' )
126128 for line in libprop :
129+ if line .startswith ("name=" ):
130+ our_name = line .replace ("depends=" , "" ).strip ()
127131 if line .startswith ("depends=" ):
128132 deps = line .replace ("depends=" , "" ).split ("," )
129133 for dep in deps :
@@ -134,6 +138,11 @@ def run_or_die(cmd, error):
134138except OSError :
135139 pass # no library properties
136140
141+ # Delete the existing library if we somehow downloaded
142+ # due to dependancies
143+ if our_name :
144+ run_or_die ("arduino-cli lib uninstall \" " + our_name + "\" " , "Could not uninstall" )
145+
137146print ("Libraries installed: " , glob .glob (os .environ ['HOME' ]+ '/Arduino/libraries/*' ))
138147
139148################################ Test platforms
You can’t perform that action at this time.
0 commit comments