1
0
mirror of https://github.com/Eugeny/tabby.git synced 2025-07-19 18:07:58 +00:00
Files
tabby/app/lib/portable.ts
Eugene Pankov 43cd3318da project rename
2021-06-29 23:57:04 +02:00

12 lines
341 B
TypeScript
Executable File

import * as path from 'path'
import * as fs from 'fs'
import * as electron from 'electron'
const appPath = path.dirname(electron.app.getPath('exe'))
const portableData = path.join(appPath, 'data')
if (fs.existsSync(portableData)) {
console.log('reset user data to ' + portableData)
electron.app.setPath('userData', portableData)
}