Skip to content

Commit

Permalink
Added folder support
Browse files Browse the repository at this point in the history
  • Loading branch information
BloodWorkXGaming committed Oct 1, 2019
1 parent 3e3e2b7 commit 97fe2ce
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
6 changes: 4 additions & 2 deletions server-setup-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,10 @@ install:

# 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
localFiles:
- from: test/All+the+Mods+3-v5.9.5.zip
to: setup/test/All+the+Mods+3-v5.9.5.zip
- from: setup/modpack-download.zip
to: setup/test/modpack-download-copied.zip
- from: out
to: setup/out

# This makes the program check the folder for whether it is supposed to use the
checkFolder: yes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@ class FileManager(private val configFile: ConfigFile) {
for (localFile in configFile.install.localFiles) {
LOGGER.info("Copying local file: $localFile")
try {
FileUtils.copyFile(File(localFile.from), File(localFile.to))
if (File(localFile.from).isDirectory) {
FileUtils.copyDirectory(File(localFile.from), File(localFile.to))
} else {
FileUtils.copyFile(File(localFile.from), File(localFile.to))
}
} catch (e: IOException) {
LOGGER.error("Error while copying local file", e)
}
Expand Down

0 comments on commit 97fe2ce

Please sign in to comment.