Skip to content

Commit e5cb2d8

Browse files
committed
fix issue 33 "Koans are not re-evaluated when file is edited using emacs"
1 parent 10b0c12 commit e5cb2d8

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

‎koans/app/lib/file-monitor.jar‎

-587 Bytes
Binary file not shown.

‎lib/file-monitor/src/com/sandwich/util/io/FileUtils.java‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,23 +41,23 @@ public File makeDestination(File dest, String fileInDirectory) {
4141
}
4242

4343
public static void forEachFile(File src, File dest, FileAction fileAction) throws IOException {
44-
if((src == null || !src.exists()) && dest == null){
45-
throw new IllegalArgumentException("Both path's must actually exist");
44+
if(src == null || !src.exists()){
45+
throw new IllegalArgumentException("Source path must actually exist");
4646
}
4747
if (src.isDirectory()) {
4848
if (!dest.exists()) {
4949
dest.mkdir();
5050
}
5151
String files[] = src.list();
5252
for (int i = 0; i < files.length; i++) {
53-
forEachFile(new File(src, files[i]), fileAction.makeDestination(dest, files[i]), fileAction);
53+
File rSrc = new File(src, files[i]);
54+
File rDest = fileAction.makeDestination(dest, files[i]);
55+
if(rSrc.exists()){
56+
forEachFile(rSrc, rDest, fileAction);
57+
}
5458
}
5559
} else {
56-
if (!src.exists()) {
57-
throw new IOException("File or directory does not exist: "+src);
58-
} else {
59-
fileAction.sourceToDestination(src, dest);
60-
}
60+
fileAction.sourceToDestination(src, dest);
6161
}
6262
}
6363

0 commit comments

Comments
 (0)