Skip to content

Commit 2889266

Browse files
committed
refactor(migrate): not create manifest.json if it exists
1 parent 3d5e3e2 commit 2889266

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/lse/PluginMigration.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,12 @@ auto migratePlugin(const PluginManager& pluginManager, const std::filesystem::pa
9999
};
100100
std::filesystem::remove(path);
101101
#endif
102+
if (!std::filesystem::exists(pluginDir / "manifest.json")) {
103+
auto manifestJson = ll::reflection::serialize<nlohmann::ordered_json>(manifest).value();
102104

103-
auto manifestJson = ll::reflection::serialize<nlohmann::ordered_json>(manifest).value();
104-
105-
std::ofstream manifestFile{pluginDir / "manifest.json"};
106-
manifestFile << manifestJson.dump(4);
105+
std::ofstream manifestFile{pluginDir / "manifest.json"};
106+
manifestFile << manifestJson.dump(4);
107+
}
107108
}
108109

109110
} // namespace

0 commit comments

Comments
 (0)