Skip to content

Commit

Permalink
Add check for Gradle wrapper, remove extra import
Browse files Browse the repository at this point in the history
  • Loading branch information
rock3r committed Sep 30, 2022
1 parent 753842f commit edc9da2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion deep-clean.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

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

import Deep_clean.CommandLineArguments
import org.docopt.Docopt
import java.io.File
import java.nio.file.Files
import java.nio.file.Paths
import java.util.concurrent.TimeUnit
import kotlin.system.exitProcess

typealias CommandLineArguments = Map<String, Any>

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

if (!File(gradlew.removePrefix("./")).exists()) {
printInBold("❌ Could not find Gradle wrapper in the work directory: $gradlew")
exitProcess(-1)
}

Runtime.getRuntime().apply {
printInBold("⏳ Executing Gradle clean...")
doWithGradleWrapper {
Expand Down

0 comments on commit edc9da2

Please sign in to comment.