Skip to content

Commit 78c53e3

Browse files
committed
Ignore directory/file exists
1 parent 68dd33a commit 78c53e3

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

src/macosMain/kotlin/com/jetbrains/handson/handson/init/FileIO.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class FileIO() {
3030

3131
fun createFolder(folderName: String) {
3232
val result = mkdir(folderName, S_IRWXU)
33-
if (result != 0 && result != EEXIST) {
33+
if (result != 0 && result != -1) {
3434
throw FileIOException(errno)
3535
}
3636
}

src/macosMain/kotlin/com/jetbrains/handson/handson/init/Main.kt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,7 @@ fun main(args: Array<String>) {
2020
handsOnInitiator.createLicenseFile()
2121
handsOnInitiator.createGitIngoreFile()
2222
handsOnInitiator.outputInstructions()
23-
} catch (e: ConfigurationException) {
24-
printErrorMessage(e)
25-
exitProcess(-1)
26-
} catch (e: HandsOnInitiatorException) {
23+
} catch (e: Exception) {
2724
printErrorMessage(e)
2825
exitProcess(-1)
2926
}

0 commit comments

Comments
 (0)