@@ -26,7 +26,7 @@ public class Shared {
26
26
private static String jantjesVirtualLinuxMachine = "/home/jantje/programs/arduino-1.8.0/hardware/teensy" ;
27
27
28
28
public static String getTeensyPlatform () {
29
- switch ( Other .getSystemHash ()) {
29
+ switch (Other .getSystemHash ()) {
30
30
case "1248215851" :
31
31
return jantjesWindowsMachine ;
32
32
case "still need to gett the key" :
@@ -74,18 +74,48 @@ public static IPath getTemplateFolder(String templateName) {
74
74
75
75
if (Platform .getOS ().equals (Platform .OS_WIN32 )) {
76
76
if (gitHome == null ) {
77
- System .err .println ("Git HOME envvar is not define. Using default value" );
78
77
gitHome = System .getenv ("HOMEDRIVE" ) + System .getenv ("HOMEPATH" );
79
78
}
80
- gitHome += "/git" ;
81
79
} else {
82
80
if (gitHome == null ) {
83
81
System .err .println ("Git HOME envvar is not define. Using default value" );
84
82
gitHome = "~" ;
85
83
}
86
- gitHome += "/.git" ;
84
+
85
+ }
86
+ Path path = new Path (gitHome + "/git/arduino-eclipse-plugin/io.sloeber.tests/src/templates/" + templateName );
87
+ if (path .toFile ().exists ()) {
88
+ return path ;
89
+ }
90
+ path = new Path (gitHome + "/.git/arduino-eclipse-plugin/io.sloeber.tests/src/templates/" + templateName );
91
+ if (path .toFile ().exists ()) {
92
+ return path ;
93
+ }
94
+ path = new Path (gitHome + "/git/Sloeber/arduino-eclipse-plugin/io.sloeber.tests/src/templates/" + templateName );
95
+ if (path .toFile ().exists ()) {
96
+ return path ;
97
+ }
98
+ path = new Path (
99
+ gitHome + "/.git/Sloeber/arduino-eclipse-plugin/io.sloeber.tests/src/templates/" + templateName );
100
+ if (path .toFile ().exists ()) {
101
+ return path ;
102
+ }
103
+ path = new Path (gitHome + "/Sloeber/arduino-eclipse-plugin/io.sloeber.tests/src/templates/" + templateName );
104
+ if (path .toFile ().exists ()) {
105
+ return path ;
106
+ }
107
+ path = new Path (
108
+ gitHome + "/Sloeber/arduino-eclipse-plugin/io.sloeber.tests/src/templates/" + templateName );
109
+ if (path .toFile ().exists ()) {
110
+ return path ;
87
111
}
88
- Path path = new Path (gitHome + "/arduino-eclipse-plugin/io.sloeber.tests/src/templates/" + templateName );
112
+ System .err .println ("Failed to find templates in git repository. Checked following locations" );
113
+ System .err .println ("->" +gitHome + "/git/arduino-eclipse-plugin/io.sloeber.tests/src/templates/" + templateName );
114
+ System .err .println ("->" +gitHome + "/.git/arduino-eclipse-plugin/io.sloeber.tests/src/templates/" + templateName );
115
+ System .err .println ("->" +gitHome + "/git/Sloeber/arduino-eclipse-plugin/io.sloeber.tests/src/templates/" + templateName );
116
+ System .err .println ("->" +gitHome + "/.git/Sloeber/arduino-eclipse-plugin/io.sloeber.tests/src/templates/" + templateName );
117
+ System .err .println ("->" +gitHome + "/Sloeber/arduino-eclipse-plugin/io.sloeber.tests/src/templates/" + templateName );
118
+ System .err .println ("->" +gitHome + "/Sloeber/arduino-eclipse-plugin/io.sloeber.tests/src/templates/" + templateName );
89
119
return path ;
90
120
}
91
121
0 commit comments