Skip to content

Commit

Permalink
Create destination dir if it does not exist (#1438)
Browse files Browse the repository at this point in the history
Otherwise DownloadAction might assume,
that the destination is actually a file,
when just one file is requested
(which is true for some POM only compose modules)
  • Loading branch information
AlexeyTsvetkov authored Nov 22, 2021
1 parent 974ef56 commit 8eeb0db
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@ abstract class DownloadFromSpaceMavenRepoTask : DefaultTask() {
}

val destinationDir = module.localDir
if (destinationDir.exists()) {

if (destinationDir.isFile)
error("Destination dir is a file: $destinationDir")
else if (destinationDir.exists()) {
if (module.version.endsWith("-SNAPSHOT")) {
destinationDir.deleteRecursively()
} else {
Expand All @@ -65,6 +68,8 @@ abstract class DownloadFromSpaceMavenRepoTask : DefaultTask() {
}
}
}
} else {
destinationDir.mkdirs()
}

DownloadAction(project, this).apply {
Expand Down
2 changes: 1 addition & 1 deletion compose/settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ pluginManagement {
maven("https://maven.pkg.jetbrains.space/public/p/space/maven")
}
dependencies {
classpath("org.jetbrains.compose.internal.build-helpers:publishing:0.1.4")
classpath("org.jetbrains.compose.internal.build-helpers:publishing:0.1.5")
}
}
}
Expand Down

0 comments on commit 8eeb0db

Please sign in to comment.