1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-18 09:35:20 +02:00
joplin/packages/lib/determineProfileDir.ts

17 lines
462 B
TypeScript

import { homedir } from 'os';
import { toSystemSlashes } from './path-utils';
export default (profileFromArgs: string, appName: string) => {
let output = '';
if (profileFromArgs) {
output = profileFromArgs;
} else if (process && process.env && process.env.PORTABLE_EXECUTABLE_DIR) {
output = `${process.env.PORTABLE_EXECUTABLE_DIR}/JoplinProfile`;
} else {
output = `${homedir()}/.config/${appName}`;
}
return toSystemSlashes(output, 'linux');
};