mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-29 19:02:55 +02:00
Migrate old logs
This commit is contained in:
parent
75bb6e5211
commit
ffac96d0a0
1 changed files with 11 additions and 0 deletions
|
@ -228,6 +228,17 @@ function deleteOldFiles(directoryPath, maxAgeInSeconds, filenameRegex) {
|
||||||
var oldLogPath = path.join(getApplicationDataDirectory(), '/logs');
|
var oldLogPath = path.join(getApplicationDataDirectory(), '/logs');
|
||||||
var logPath = path.join(getApplicationDataDirectory(true), '/logs');
|
var logPath = path.join(getApplicationDataDirectory(true), '/logs');
|
||||||
|
|
||||||
|
if (oldLogPath != logPath) {
|
||||||
|
console.log("Migrating old logs from " + oldLogPath + " to " + logPath);
|
||||||
|
fs.copy(oldLogPath, logPath, err => {
|
||||||
|
if (err) {
|
||||||
|
console.error(err);
|
||||||
|
} else {
|
||||||
|
console.log('success!');
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
log.debug("Log directory:", logPath);
|
log.debug("Log directory:", logPath);
|
||||||
log.debug("Data directory:", getRootHifiDataDirectory());
|
log.debug("Data directory:", getRootHifiDataDirectory());
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue