Skip to content

Commit 410da98

Browse files
committed
feat: allow specifying a destination path within the server dir
* instead of the default `plugins` path * makes it possible to use fabric servers (setting destPath to `mods`)
1 parent 0b162b8 commit 410da98

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

docker-tools/src/main/kotlin/com/wolfyscript/devtools/docker/minecraft/MinecraftServersExtension.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ abstract class MinecraftServersExtension(objects: ObjectFactory, project: Projec
2626
libDir.convention(this@MinecraftServersExtension.libDir)
2727
libName.convention(this@MinecraftServersExtension.libName)
2828
destFileName.convention("${project.name}.jar")
29+
destPath.convention("plugins")
2930
}
3031
servers.all {
3132
val serverPath: String = serverDir.get().asFile.path
@@ -41,10 +42,10 @@ abstract class MinecraftServersExtension(objects: ObjectFactory, project: Projec
4142
}
4243

4344
val file: RegularFile = libDir.get().file(libName.get())
44-
println("copy: ${file.asFile.path} to server $serverPath/plugins")
45+
println("copy: ${file.asFile.path} to server $serverPath/${destPath.get()}/")
4546
from(file)
4647
rename(".*", destFileName.get())
47-
into("$serverPath/plugins")
48+
into("$serverPath/${destPath.get()}/")
4849
}
4950

5051
val stopTask = project.tasks.register<DockerStopTask>("${name}_stop") {

docker-tools/src/main/kotlin/com/wolfyscript/devtools/docker/minecraft/ServerEntry.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,16 @@ abstract class ServerEntry {
2323
@get:Optional
2424
abstract val serverDir: DirectoryProperty
2525

26+
2627
@get:Optional
2728
abstract val libName: Property<String>
2829

2930
@get:Optional
3031
abstract val destFileName: Property<String>
3132

33+
@get:Optional
34+
abstract val destPath: Property<String>
35+
3236
@get:Optional
3337
abstract val libDir: DirectoryProperty
3438

0 commit comments

Comments
 (0)