mirror of
https://github.com/Eugeny/tabby.git
synced 2025-09-12 19:34:34 +00:00
Fix: sentry will use userData before redirect it, ahead of the time
This commit is contained in:
15
app/lib/portable.ts
Executable file
15
app/lib/portable.ts
Executable file
@@ -0,0 +1,15 @@
|
||||
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)
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user