mirror of
https://github.com/laurent22/joplin.git
synced 2024-12-21 09:38:01 +02:00
17 lines
644 B
TypeScript
17 lines
644 B
TypeScript
import { getCurrentProfile, getProfileFullPath, isSubProfile, loadProfileConfig } from '.';
|
|
import Setting from '../../models/Setting';
|
|
|
|
export default async (rootProfileDir: string) => {
|
|
const profileConfig = await loadProfileConfig(`${rootProfileDir}/profiles.json`);
|
|
const profileDir = getProfileFullPath(getCurrentProfile(profileConfig), rootProfileDir);
|
|
const isSub = isSubProfile(getCurrentProfile(profileConfig));
|
|
Setting.setConstant('isSubProfile', isSub);
|
|
Setting.setConstant('rootProfileDir', rootProfileDir);
|
|
Setting.setConstant('profileDir', profileDir);
|
|
return {
|
|
profileConfig,
|
|
profileDir,
|
|
isSubProfile: isSub,
|
|
};
|
|
};
|