|
30 | 30 | import org.eclipse.core.runtime.IPath;
|
31 | 31 | import org.eclipse.core.runtime.IProgressMonitor;
|
32 | 32 | import org.eclipse.core.runtime.IStatus;
|
| 33 | +import org.eclipse.core.runtime.Path; |
33 | 34 | import org.eclipse.core.runtime.Status;
|
34 | 35 | import org.eclipse.core.runtime.SubMonitor;
|
35 | 36 |
|
@@ -267,14 +268,30 @@ private static BoardDescription getBoardDescription(KeyValueTree oldConfig) {
|
267 | 268 | if(boardsFileString.isBlank() || boardID.isBlank()) {
|
268 | 269 | return new BoardDescription();
|
269 | 270 | }
|
| 271 | + Path readBoardsFilePath=new Path(boardsFileString); |
| 272 | + IPath foundBoardsFilePath=null; |
| 273 | + String[] segments =readBoardsFilePath.segments(); |
| 274 | + for(String curSegment:segments) { |
| 275 | + |
| 276 | + if(foundBoardsFilePath!=null) { |
| 277 | + foundBoardsFilePath=foundBoardsFilePath.append(curSegment); |
| 278 | + }else { |
| 279 | + if(SLOEBER_HOME_SUB_FOLDER.equals( curSegment)) { |
| 280 | + foundBoardsFilePath=new Path(sloeberHome).append(curSegment); |
| 281 | + } |
| 282 | + } |
| 283 | + } |
| 284 | + if (foundBoardsFilePath == null) { |
| 285 | + return new BoardDescription(); |
| 286 | + } |
270 | 287 |
|
271 | 288 | KeyValueTree optionsHolder=oldConfig.getChild("board.BOARD.MENU"); //$NON-NLS-1$
|
272 | 289 |
|
273 | 290 | Map<String, String> options=new HashMap<>();
|
274 | 291 | for(KeyValueTree curOption:optionsHolder.getChildren().values()) {
|
275 | 292 | options.put(curOption.getKey(), curOption.getValue());
|
276 | 293 | }
|
277 |
| - File boardsFile=new File(boardsFileString); |
| 294 | + File boardsFile=foundBoardsFilePath.toFile();// new File(boardsFileString); |
278 | 295 |
|
279 | 296 | BoardDescription ret= new BoardDescription( boardsFile, boardID, options);
|
280 | 297 | String uploadPort=oldConfig.getValue("board.UPLOAD.PORT"); //$NON-NLS-1$
|
|
0 commit comments