mirror of
https://github.com/eugeny/tabby
synced 2026-09-26 06:56:17 +00:00
16 lines
440 B
TypeScript
Executable File
16 lines
440 B
TypeScript
Executable File
import * as path from 'path'
|
|
import * as fs from 'fs'
|
|
|
|
if (process.env.PORTABLE_EXECUTABLE_DIR) {
|
|
const portableData = path.join(process.env.PORTABLE_EXECUTABLE_DIR, 'terminus-data')
|
|
if (!fs.existsSync(portableData)) {
|
|
fs.mkdirSync(portableData)
|
|
}
|
|
|
|
try {
|
|
require('electron').app.setPath('userData', portableData)
|
|
} catch {
|
|
require('electron').remote.app.setPath('userData', portableData)
|
|
}
|
|
}
|