Skip to content

Commit d56a1cf

Browse files
committed
update: increment version to 1.0.1 and enhance config update logging
1 parent 5ff0691 commit d56a1cf

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ plugins {
44
}
55

66
group = 'io.github.pluginupdatecore'
7-
version = '1.0.0'
7+
version = '1.0.1'
88

99
repositories {
1010
mavenCentral()

src/main/java/io/github/pluginupdatecore/updater/ConfigUpdater.java

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,13 @@ public void checkAndUpdateConfig() {
107107
return;
108108
}
109109

110-
plugin.getLogger().info("Updating config from version " + configVersionStr + " to " + currentVersion);
110+
// Check if this is a first-time installation (version 0.0.0)
111+
boolean isFirstInstall = configVersionStr.equals("0.0.0");
112+
113+
// Only log update messages if this is not a first-time installation
114+
if (!isFirstInstall) {
115+
plugin.getLogger().info("Updating config from version " + configVersionStr + " to " + currentVersion);
116+
}
111117

112118
try {
113119
// Store user's current values
@@ -123,11 +129,12 @@ public void checkAndUpdateConfig() {
123129
// Check if there are actual differences before creating backup
124130
boolean configDiffers = hasConfigDifferences(userValues, newConfig);
125131

126-
if (configDiffers) {
132+
// Only create backup and log if this is not a first-time installation
133+
if (configDiffers && !isFirstInstall) {
127134
File backupFile = new File(plugin.getDataFolder(), "config_backup_" + configVersionStr + ".yml");
128135
Files.copy(configFile.toPath(), backupFile.toPath(), StandardCopyOption.REPLACE_EXISTING);
129136
plugin.getLogger().info("Config backup created at " + backupFile.getName());
130-
} else {
137+
} else if (!isFirstInstall) {
131138
plugin.getLogger().info("No significant config changes detected, skipping backup creation");
132139
}
133140

@@ -137,7 +144,10 @@ public void checkAndUpdateConfig() {
137144
tempFile.delete();
138145
plugin.reloadConfig();
139146

140-
plugin.getLogger().info("Successfully updated config.yml to version " + currentVersion);
147+
// Only log success message if this is not a first-time installation
148+
if (!isFirstInstall) {
149+
plugin.getLogger().info("Successfully updated config.yml to version " + currentVersion);
150+
}
141151

142152
} catch (Exception e) {
143153
plugin.getLogger().severe("Failed to update config: " + e.getMessage());

0 commit comments

Comments
 (0)