Skip to content

Commit a43eb4a

Browse files
committed
removed unneccassary exception handling
1 parent e073891 commit a43eb4a

File tree

1 file changed

+14
-25
lines changed

1 file changed

+14
-25
lines changed

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

Lines changed: 14 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,8 @@ public int config() throws Exception {
5757
public int cloneCmd(@Parameters(index = "0") String url) {
5858
File configFilePath = getConfigFilePath(); // Get path for config file
5959

60-
try {
61-
if (!configFilePath.exists()) {// Check if config file exist
62-
defaultConfig();
63-
}
64-
} catch (Exception e) {
65-
e.printStackTrace();
66-
60+
if (!configFilePath.exists()) {// Check if config file exist
61+
defaultConfig(); // Sets up default config
6762
}
6863

6964
CloneUrl cloneUrl = new CloneUrl(url);
@@ -161,29 +156,23 @@ public static File getConfigFile() {
161156

162157
}
163158

164-
// Function to load default config
165-
public void defaultConfig() {
159+
// Function to setup default config
160+
void defaultConfig() {
166161
String path_env = System.getenv("Path"); // System PATH variable
167162
clone_path = System.getProperty("user.home") + "/code"; // set clone_path to /home/user_name/code
168163

169-
try {
170-
if(isWindows()){// check if Windows OS
171-
if(path_env.contains("Microsoft VS Code")){ // If PATH has VScode
172-
ide = "code.cmd";
173-
} else if(path_env.contains("IntelliJ IDEA")){ // If PATH has IntelliJ
174-
ide = "idea64.exe";
175-
}
164+
if(isWindows()){// check if Windows OS
165+
if(path_env.contains("Microsoft VS Code")){ // If PATH has VScode
166+
ide = "code.cmd";
167+
} else if(path_env.contains("IntelliJ IDEA")){ // If PATH has IntelliJ
168+
ide = "idea64.exe";
176169
}
177-
// check if Linux OS
178-
// if(isLinux()){}
179-
180-
// check if Mac OS
181-
// if(isMac()){}
182-
183-
} catch (Exception e) {
184-
e.printStackTrace();
185-
186170
}
171+
// check if Linux OS
172+
// if(isLinux()){}
173+
174+
// check if Mac OS
175+
// if(isMac()){}
187176
}
188177
// Function to edit configuration and serves for command line starfix config
189178
// editor

0 commit comments

Comments
 (0)