Skip to content
This repository was archived by the owner on Feb 16, 2022. It is now read-only.

Commit e69d3c2

Browse files
committed
api(config): 無条件で default が書き込むバグを修正
1 parent 48042b2 commit e69d3c2

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ repositories {
177177
}
178178
179179
dependencies {
180-
api('com.github.sya-ri:EasySpigotAPI:1.3.2') {
180+
api('com.github.sya-ri:EasySpigotAPI:1.3.3') {
181181
exclude group: 'org.spigotmc', module: 'spigot-api'
182182
}
183183
}
@@ -191,7 +191,7 @@ repositories {
191191
}
192192

193193
dependencies {
194-
api("com.github.sya-ri:EasySpigotAPI:1.3.2") {
194+
api("com.github.sya-ri:EasySpigotAPI:1.3.3") {
195195
exclude(group = "org.spigotmc", module = "spigot-api")
196196
}
197197
}
@@ -217,7 +217,7 @@ configurations {
217217
}
218218
219219
dependencies {
220-
shadowApi('com.github.sya-ri:EasySpigotAPI:1.3.2') {
220+
shadowApi('com.github.sya-ri:EasySpigotAPI:1.3.3') {
221221
exclude group: 'org.spigotmc', module: 'spigot-api'
222222
}
223223
}
@@ -242,7 +242,7 @@ repositories {
242242
}
243243

244244
dependencies {
245-
shadowApi("com.github.sya-ri:EasySpigotAPI:1.3.2") {
245+
shadowApi("com.github.sya-ri:EasySpigotAPI:1.3.3") {
246246
exclude(group = "org.spigotmc", module = "spigot-api")
247247
}
248248
}

api/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ repositories {
1111
}
1212

1313
group = "com.github.sya-ri.spigot.api"
14-
version = "1.3.2"
14+
version = "1.3.3"
1515

1616
bukkit {
1717
name = "EasySpigotAPI"

api/src/main/kotlin/com/github/syari/spigot/api/config/CustomConfig.kt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,19 @@ class CustomConfig internal constructor(
3333
val config: YamlConfiguration
3434

3535
init {
36-
if (file.exists().not()) {
36+
val writeDefault = if (file.exists().not()) {
3737
try {
3838
file.parentFile.mkdirs()
3939
file.createNewFile()
4040
} catch (ex: IOException) {
4141
throw IOException("$filePath の作成に失敗しました")
4242
}
43+
default.isNotEmpty()
44+
} else {
45+
false
4346
}
4447
config = YamlConfiguration.loadConfiguration(file)
45-
if (default.isNotEmpty()) {
48+
if (writeDefault) {
4649
default.forEach { (key, value) ->
4750
setUnsafe(key, value)
4851
}

0 commit comments

Comments
 (0)