Skip to content

Commit 3d1ec4e

Browse files
authored
Merge pull request #102 from zedbeit/starfix-default-config-2
2 parents 14d3c4d + bb195db commit 3d1ec4e

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

cli/src/main/java/dev/starfix/Starfix.java

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ public static File getConfigFile() {
158158

159159
// Function to setup default config
160160
void defaultConfig() {
161-
String path_env = System.getenv("Path"); // System PATH variable
161+
String path_env = System.getenv("PATH"); // System PATH variable
162162
clone_path = System.getProperty("user.home") + "/code"; // set clone_path to /home/user_name/code
163163

164164
if(isWindows()){// check if Windows OS
@@ -168,8 +168,20 @@ void defaultConfig() {
168168
ide = "idea64.exe";
169169
}
170170
}
171-
// check if Linux OS
172-
// if(isLinux()){}
171+
172+
if(isLinux()){// check if Linux OS
173+
String[] sub_paths = path_env.split(":");
174+
175+
for (String sub_path : sub_paths) {
176+
if(Files.exists(Paths.get(sub_path+"/code"))){
177+
ide = "code";
178+
}else if(Files.exists(Paths.get(sub_path+"/idea"))){
179+
ide = "idea";
180+
}else if(Files.exists(Paths.get(sub_path+"/eclipse"))){
181+
ide = "eclipse";
182+
}
183+
}
184+
}
173185

174186
// check if Mac OS
175187
// if(isMac()){}

0 commit comments

Comments
 (0)