Skip to content

Commit edc9da2

Browse files
committed
Add check for Gradle wrapper, remove extra import
1 parent 753842f commit edc9da2

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

deep-clean.kts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
@file:DependsOn("com.offbytwo:docopt:0.6.0.20150202")
44

5-
import Deep_clean.CommandLineArguments
65
import org.docopt.Docopt
76
import java.io.File
87
import java.nio.file.Files
98
import java.nio.file.Paths
109
import java.util.concurrent.TimeUnit
10+
import kotlin.system.exitProcess
1111

1212
typealias CommandLineArguments = Map<String, Any>
1313

@@ -76,6 +76,11 @@ if (dryRun) println("\nℹ️ This is a dry-run. No files will be moved/deleted
7676
val wetRun = dryRun.not()
7777
val gradlew = "./gradlew" + if (isOsWindows()) ".bat" else ""
7878

79+
if (!File(gradlew.removePrefix("./")).exists()) {
80+
printInBold("❌ Could not find Gradle wrapper in the work directory: $gradlew")
81+
exitProcess(-1)
82+
}
83+
7984
Runtime.getRuntime().apply {
8085
printInBold("⏳ Executing Gradle clean...")
8186
doWithGradleWrapper {

0 commit comments

Comments
 (0)