Skip to content

Commit 97fe2ce

Browse files
Added folder support
1 parent 3e3e2b7 commit 97fe2ce

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

server-setup-config.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,10 @@ install:
9999

100100
# For often there are config which the user wants to change, here is the place to put the local path to configs, jars or whatever
101101
localFiles:
102-
- from: test/All+the+Mods+3-v5.9.5.zip
103-
to: setup/test/All+the+Mods+3-v5.9.5.zip
102+
- from: setup/modpack-download.zip
103+
to: setup/test/modpack-download-copied.zip
104+
- from: out
105+
to: setup/out
104106

105107
# This makes the program check the folder for whether it is supposed to use the
106108
checkFolder: yes

src/main/kotlin/atm/bloodworkxgaming/serverstarter/FileManager.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,11 @@ class FileManager(private val configFile: ConfigFile) {
4242
for (localFile in configFile.install.localFiles) {
4343
LOGGER.info("Copying local file: $localFile")
4444
try {
45-
FileUtils.copyFile(File(localFile.from), File(localFile.to))
45+
if (File(localFile.from).isDirectory) {
46+
FileUtils.copyDirectory(File(localFile.from), File(localFile.to))
47+
} else {
48+
FileUtils.copyFile(File(localFile.from), File(localFile.to))
49+
}
4650
} catch (e: IOException) {
4751
LOGGER.error("Error while copying local file", e)
4852
}

0 commit comments

Comments
 (0)