Compare commits

...

2 Commits

Author SHA1 Message Date
FinnHornhoover
9aa5c4402f
Merge 16a158906d into b5ab9aad2d 2024-06-07 08:46:09 +00:00
FinnHornhoover
16a158906d add guards for file backup 2024-06-07 11:46:01 +03:00

View File

@ -34,10 +34,10 @@ function initialSetup(firstTime) {
if (!firstTime) {
// Migration from pre-1.6
// Back everything up, just in case
fs.copySync(configPath, configPath + ".bak");
fs.copySync(serversPath, serversPath + ".bak");
fs.copySync(versionsPath, versionsPath + ".bak");
fs.copySync(hashPath, hashPath + ".bak");
if (fs.existsSync(configPath)) fs.copySync(configPath, configPath + ".bak");
if (fs.existsSync(serversPath)) fs.copySync(serversPath, serversPath + ".bak");
if (fs.existsSync(versionsPath)) fs.copySync(versionsPath, versionsPath + ".bak");
if (fs.existsSync(hashPath)) fs.copySync(hashPath, hashPath + ".bak");
} else {
// First-time setup
// Copy default servers