mirror of
https://github.com/OpenFusionProject/Client.git
synced 2024-11-22 05:30:05 +00:00
add guards for file backup
This commit is contained in:
parent
7f9c5d90a1
commit
16a158906d
8
index.js
8
index.js
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user