Skip to content

Commit

Permalink
fix: Portable path (backport) (#3161)
Browse files Browse the repository at this point in the history
  • Loading branch information
ffflorian authored Oct 28, 2019
1 parent 9cda28d commit f917ec4
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions electron/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -424,11 +424,12 @@ const addLinuxWorkarounds = () => {
};

const handlePortableFlags = () => {
if (argv.portable || argv.user_data_dir) {
const USER_PATH =
path.resolve(argv.user_data_dir) || path.join(process.env.APPIMAGE || process.execPath, '../Data');
if (argv.user_data_dir || argv.portable) {
const USER_PATH = argv.user_data_dir
? path.resolve(argv.user_data_dir)
: path.join(process.env.APPIMAGE || process.execPath, '../Data');

console.log(`Saving user data to ${USER_PATH}`);
logger.log(`Saving user data to "${USER_PATH}".`);
app.setPath('userData', USER_PATH);
}
};
Expand Down

0 comments on commit f917ec4

Please sign in to comment.