()
| 1327 | |
| 1328 | |
| 1329 | private void updateNameProperties() { |
| 1330 | // If the main file and the sketch name are not identical, |
| 1331 | // update sketch.properties. |
| 1332 | String mainName = mainFile.getName(); |
| 1333 | String defaultName = name + "." + mode.getDefaultExtension(); |
| 1334 | //System.out.println("main name is " + mainName + " and default name is " + defaultName); |
| 1335 | |
| 1336 | try { |
| 1337 | // Read the old sketch.properties file if it already exists |
| 1338 | Settings props = loadProperties(folder); |
| 1339 | |
| 1340 | if (mainName.equals(defaultName)) { |
| 1341 | props.remove("main"); |
| 1342 | } else { |
| 1343 | props.set("main", mainName); |
| 1344 | } |
| 1345 | //System.out.println("props size is now " + props.getMap().size()); |
| 1346 | props.reckon(); |
| 1347 | |
| 1348 | } catch (IOException e) { |
| 1349 | System.err.println("Error while updating sketch.properties"); |
| 1350 | e.printStackTrace(); |
| 1351 | } |
| 1352 | } |
| 1353 | |
| 1354 | |
| 1355 | /** |
no test coverage detected