Refactor dataPath assignment

Replaced direct assignment of `dataPath` with variable `nameDataPath` for consistent naming. Introduced `getNameDataPath` function to return the launcher directory name string.
This commit is contained in:
Sandro642 2024-10-24 23:39:45 +02:00
parent 9d4c8cc399
commit 48350019f2

View File

@ -7,7 +7,9 @@ const logger = LoggerUtil.getLogger('ConfigManager')
const sysRoot = process.env.APPDATA || (process.platform == 'darwin' ? process.env.HOME + '/Library/Application Support' : process.env.HOME) const sysRoot = process.env.APPDATA || (process.platform == 'darwin' ? process.env.HOME + '/Library/Application Support' : process.env.HOME)
const dataPath = path.join(sysRoot, '.helioslauncher') const nameDataPath = '.helioslauncher'
const dataPath = path.join(sysRoot, nameDataPath)
const launcherDir = require('@electron/remote').app.getPath('userData') const launcherDir = require('@electron/remote').app.getPath('userData')
@ -18,7 +20,9 @@ const launcherDir = require('@electron/remote').app.getPath('userData')
* *
* @type {string} * @type {string}
*/ */
exports.dataPath = dataPath exports.getNameDataPath = function(){
return nameDataPath
}
/** /**
* Retrieve the absolute path of the launcher directory. * Retrieve the absolute path of the launcher directory.