Skip to content

Commit 14aacd1

Browse files
committed
added ability to start using the commandline
1 parent 59347eb commit 14aacd1

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

src/main/java/Main.java

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,25 @@
11
import entity.ClassEntity;
22

3+
import java.io.File;
34
import java.io.IOException;
45
import java.nio.file.Path;
56
import java.util.List;
67

78

89
public class Main {
910
public static void main(String[] args) throws IOException {
10-
final String rootDirectory = "C:\\Projects\\TestSmells_ExisitngTools\\samples\\bad";
11+
if (args == null) {
12+
System.out.println("Please provide the path to the project directory");
13+
return;
14+
}
15+
if(!args[0].isEmpty()){
16+
File inputFile = new File(args[0]);
17+
if(!inputFile.exists() || !inputFile.isDirectory()) {
18+
System.out.println("Please provide a valid path to the project directory");
19+
return;
20+
}
21+
}
22+
final String rootDirectory = args[0];
1123
TestFileDetector testFileDetector = TestFileDetector.createTestFileDetector();
1224
ResultsWriter resultsWriter = ResultsWriter.createResultsWriter();
1325
ClassEntity classEntity;

0 commit comments

Comments
 (0)