File tree 1 file changed +17
-6
lines changed
1 file changed +17
-6
lines changed Original file line number Diff line number Diff line change @@ -122,18 +122,29 @@ def get_boards(boardstxt):
122
122
libpaths [line ["location" ]] = pathlib .Path (line ["dir" ])
123
123
124
124
# platform lib path is already known, obviously, since that's where this script resides
125
- userlibs = pathlib .Path (libpaths ["user" ])
126
- if userlibs .exists ():
127
- userlibs = userlibs .resolve ()
128
- libs = [u .name for u in userlibs .iterdir () if u .is_dir ()]
129
- else :
125
+ if "user" in libpaths .keys () :
126
+ userlibs = pathlib .Path (libpaths ["user" ])
127
+ if userlibs .exists ():
128
+ userlibs = userlibs .resolve ()
129
+ libs = [u .name for u in userlibs .iterdir () if u .is_dir ()]
130
+ else :
131
+ print (
132
+ f"""Warning: Cannot find { userlibs } .
133
+ This has likely to do with your arduino-cli configuration.
134
+ Please refer to the following link for setup details:
135
+ https://arduino.github.io/arduino-cli/latest/getting-started/#create-a-configuration-file
136
+ """
137
+ )
138
+ libs = list ()
139
+ else :
130
140
print (
131
- f """Warning: Cannot find { userlibs } .
141
+ """No user library path found through arduino-cli (falling back to "~/Arduino/libraries") .
132
142
This has likely to do with your arduino-cli configuration.
133
143
Please refer to the following link for setup details:
134
144
https://arduino.github.io/arduino-cli/latest/getting-started/#create-a-configuration-file
135
145
"""
136
146
)
147
+ userlibs = pathlib .Path .home ()/ "Arduino/libraries"
137
148
libs = list ()
138
149
139
150
corepath = pathlib .Path (__file__ ).parent .parent .parent .resolve ()
You can’t perform that action at this time.
0 commit comments