File tree Expand file tree Collapse file tree 1 file changed +19
-2
lines changed
io.sloeber.core/src/jUnit Expand file tree Collapse file tree 1 file changed +19
-2
lines changed Original file line number Diff line number Diff line change 9
9
import org .eclipse .core .runtime .CoreException ;
10
10
import org .eclipse .core .runtime .IPath ;
11
11
import org .eclipse .core .runtime .Path ;
12
+ import org .eclipse .core .runtime .Platform ;
12
13
import org .eclipse .core .runtime .jobs .IJobManager ;
13
14
import org .eclipse .core .runtime .jobs .Job ;
14
15
@@ -47,8 +48,24 @@ public static void waitForAllJobsToFinish() {
47
48
}
48
49
49
50
public static IPath getTemplateFolder (String templateName ) {
50
- Path path = new Path ("C:/Users/jan/git/arduino-eclipse-plugin/io.sloeber.core/src/jUnit/templates" );
51
- return path .append (templateName );
51
+
52
+ String gitHome = System .getenv ("HOME" );
53
+
54
+ if (Platform .getOS ().equals (Platform .OS_WIN32 )) {
55
+ if (gitHome == null ) {
56
+ System .err .println ("Git HOME envvar is not define. Using default value" );
57
+ gitHome = System .getenv ("HOMEDRIVE" ) + System .getenv ("HOMEPATH" );
58
+ }
59
+ gitHome += "/git" ;
60
+ } else {
61
+ if (gitHome == null ) {
62
+ System .err .println ("Git HOME envvar is not define. Using default value" );
63
+ gitHome = "~" ;
64
+ }
65
+ gitHome += "/.git" ;
66
+ }
67
+ Path path = new Path (gitHome + "/arduino-eclipse-plugin/io.sloeber.core/src/jUnit/templates/" + templateName );
68
+ return path ;
52
69
}
53
70
54
71
}
You can’t perform that action at this time.
0 commit comments