1
0
mirror of https://github.com/fabianonline/telegram_backup.git synced 2024-11-23 01:06:17 +00:00

config.sample.ini is copied into the data directory on every run.

This commit is contained in:
Fabian Schlenz 2018-03-07 06:07:16 +01:00
parent 07572c0618
commit 53fcd36e66
2 changed files with 27 additions and 2 deletions

View File

@ -10,7 +10,7 @@ object IniSettings {
init { init {
loadIni(UserManager.getInstance().fileBase + "config.ini") loadIni(UserManager.getInstance().fileBase + "config.ini")
copySampleIni(UserManager.getInstance().fileBase + "config.ini.sample") copySampleIni(UserManager.getInstance().fileBase + "config.sample.ini")
} }
fun loadIni(filename: String) { fun loadIni(filename: String) {
@ -44,7 +44,9 @@ object IniSettings {
} }
fun copySampleIni(filename: String) { fun copySampleIni(filename: String) {
val stream = Config::class.java.getResourceAsStream("/config.sample.ini")
File(filename).outputStream().use { stream.copyTo(it) }
stream.close()
} }
fun println() = println(settings) fun println() = println(settings)

View File

@ -0,0 +1,23 @@
# Config file for telegram_backup
# Copy it to config.ini to use it. This sample file be overwritten on every run.
#
# Lines starting with '#' are ignored.
# Settings have the form 'key = value'
# To unset a setting, use 'key =' (or just don't use that key at all)
# Some settings may appear more than once.
## GMaps key to use. Leave empty / don't set a value to use the built in key.
# gmaps_key = mysecretgmapskey
## Use pagination in the HTML export?
# pagination = true
# pagination_size = 5000
## Don't download media files
# no_media = false
## Don't download supergroups and channels by default
# download_channels = false
# download_supergroups = false