Skip to content

Commit

Permalink
Unified path structure (#672)
Browse files Browse the repository at this point in the history
* Unified path structure

* Update setting.js

* Update setting.js
  • Loading branch information
ivysrono authored Mar 22, 2020
1 parent 34c37b1 commit 202c6fd
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/setting.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ const fs = require('fs')
const path = require('path')
const {app, BrowserWindow} = require('electron')

const portableDir = process.env.PORTABLE_EXECUTABLE_DIR
for (let dir of [
(exports.userDataDirectory =
process.env.PORTABLE_EXECUTABLE_DIR || app.getPath('userData')),
(exports.userDataDirectory = portableDir
? path.join(portableDir, 'Sabaki')
: app.getPath('userData')),
(exports.themesDirectory = path.join(exports.userDataDirectory, 'themes')),
(exports.langDirectory = path.join(exports.userDataDirectory, 'lang'))
]) {
Expand Down

0 comments on commit 202c6fd

Please sign in to comment.