Skip to content

Commit 7f239c1

Browse files
author
jantje
committed
#1268 save paths with slach and not backslach
1 parent 4265b73 commit 7f239c1

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

io.sloeber.core/src/io/sloeber/core/api/BoardDescription.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -803,7 +803,7 @@ private Map<String, String> onlyKeepValidOptions(Map<String, String> options) {
803803
*/
804804
public Map<String, String> getEnvVarsConfig(String prefix) {
805805
Map<String, String> allVars = new TreeMap<>();
806-
String board_txt = makePathEnvironmentString(getReferencingBoardsFile());
806+
String board_txt = makePathVersionString(getReferencingBoardsFile());
807807

808808
allVars.put(prefix + KEY_SLOEBER_PROGRAMMER, myProgrammer);
809809
allVars.put(prefix + KEY_SLOEBER_BOARD_ID, myBoardID);

io.sloeber.core/src/io/sloeber/core/common/Common.java

+7
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ public class Common extends Const {
2828
public final static String sloeberHome = getSloeberHome();
2929
public final static IPath sloeberHomePath = new Path(sloeberHome);
3030
public final static String sloeberHomePathToOSString = sloeberHomePath.toOSString();
31+
public final static String sloeberHomePathToString = sloeberHomePath.toString();
3132

3233
private static String getSloeberHome() {
3334

@@ -229,6 +230,12 @@ public static String makePathEnvironmentString(File file) {
229230
return file.getPath().replace(sloeberHomePathToOSString, SLOEBER_HOME_VAR);
230231
}
231232

233+
public static String makePathVersionString(File file) {
234+
String osPathString = file.getPath();
235+
IPath path = new Path(osPathString);
236+
return path.toString().replace(sloeberHomePathToString, SLOEBER_HOME_VAR);
237+
}
238+
232239
public static File resolvePathEnvironmentString(File file) {
233240
String retString = file.getPath().replace(SLOEBER_HOME_VAR, sloeberHomePathToOSString);
234241
return new File(retString);

0 commit comments

Comments
 (0)