mirror of
https://github.com/ethauvin/kobalt.git
synced 2025-04-27 08:38:13 -07:00
Don't overwrite build file with --init if it already exists.
Fixes #107.
This commit is contained in:
parent
4ba62269c5
commit
edb737f52a
1 changed files with 8 additions and 2 deletions
|
@ -28,8 +28,14 @@ public class ProjectGenerator @Inject constructor(val pluginInfo: PluginInfo){
|
|||
val contributor = ActorUtils.selectAffinityActor(pluginInfo.initContributors, File("."))
|
||||
File(args.buildFile).parentFile.mkdirs()
|
||||
if (contributor != null) {
|
||||
contributor.generateBuildFile(FileOutputStream(File(args.buildFile)))
|
||||
log(1, "Created ${args.buildFile}")
|
||||
with(File(args.buildFile)) {
|
||||
if (exists()) {
|
||||
log(1, "Build file $path already exists, not overwriting it")
|
||||
} else {
|
||||
contributor.generateBuildFile(FileOutputStream(this))
|
||||
log(1, "Created $path")
|
||||
}
|
||||
}
|
||||
} else {
|
||||
log(1, "Couldn't identify project, not generating any build file")
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue