mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-01-31 04:19:15 +08:00
For Linux Snap, move local storage, etc. to SNAP_USER_COMMON
This commit is contained in:
parent
515b01de84
commit
f0c45d7c4e
2 changed files with 13 additions and 5 deletions
|
@ -16,16 +16,25 @@ if (typeof process.setFdLimit === 'function') {
|
|||
}
|
||||
|
||||
const setupConfigDir = args => {
|
||||
let defaultDirName = 'Mailspring';
|
||||
let dirname = 'Mailspring';
|
||||
if (args.devMode) {
|
||||
defaultDirName = 'Mailspring-dev';
|
||||
dirname = 'Mailspring-dev';
|
||||
}
|
||||
if (args.specMode) {
|
||||
defaultDirName = 'Mailspring-spec';
|
||||
dirname = 'Mailspring-spec';
|
||||
}
|
||||
const configDirPath = path.join(app.getPath('appData'), defaultDirName);
|
||||
let configDirPath = path.join(app.getPath('appData'), dirname);
|
||||
if (process.platform === 'linux' && process.env.SNAP) {
|
||||
// for linux snap, use the sandbox directory that is persisted between snap revisions
|
||||
configDirPath = process.env.SNAP_USER_COMMON;
|
||||
}
|
||||
|
||||
// crete the directory
|
||||
mkdirp.sync(configDirPath);
|
||||
|
||||
// tell Electron to use this folder for local storage, etc. as well
|
||||
app.setPath('userData', configDirPath);
|
||||
|
||||
return configDirPath;
|
||||
};
|
||||
|
||||
|
|
|
@ -40,7 +40,6 @@ apps:
|
|||
# ensure libappindicator has readable resources.
|
||||
environment:
|
||||
HOME: $SNAP_USER_COMMON
|
||||
XDG_CONFIG_HOME: "$SNAP_USER_COMMON/.config"
|
||||
TMPDIR: $XDG_RUNTIME_DIR
|
||||
plugs:
|
||||
- avahi-observe
|
||||
|
|
Loading…
Reference in a new issue