File tree Expand file tree Collapse file tree 1 file changed +15
-3
lines changed
cli/src/main/java/dev/starfix Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Original file line number Diff line number Diff 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()){}
You can’t perform that action at this time.
0 commit comments