Meriadec Pillet
7 years ago
committed by
GitHub
5 changed files with 21 additions and 15 deletions
@ -0,0 +1,17 @@ |
|||
// @flow
|
|||
|
|||
import path from 'path' |
|||
import rimraf from 'rimraf' |
|||
import resolveUserDataDirectory from './resolveUserDataDirectory' |
|||
|
|||
export const resolveLogsDirectory = () => { |
|||
const { LEDGER_LOGS_DIRECTORY } = process.env |
|||
if (LEDGER_LOGS_DIRECTORY) return LEDGER_LOGS_DIRECTORY |
|||
const electron = require('electron') |
|||
return path.resolve((electron.app || electron.remote.app).getPath('userData'), 'logs') |
|||
} |
|||
|
|||
export const cleanUpBeforeClosingSync = () => { |
|||
rimraf.sync(resolveLogsDirectory(), { disableGlob: true }) |
|||
rimraf.sync(path.resolve(resolveUserDataDirectory(), 'sqlite/*.log')) |
|||
} |
@ -1,12 +0,0 @@ |
|||
// @flow
|
|||
|
|||
import path from 'path' |
|||
|
|||
const resolveLogsDirectory = () => { |
|||
const { LEDGER_LOGS_DIRECTORY } = process.env |
|||
if (LEDGER_LOGS_DIRECTORY) return LEDGER_LOGS_DIRECTORY |
|||
const electron = require('electron') |
|||
return path.resolve((electron.app || electron.remote.app).getPath('userData'), 'logs') |
|||
} |
|||
|
|||
export default resolveLogsDirectory |
Loading…
Reference in new issue