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

17 lines
625 B
TypeScript
Raw Normal View History

import { getCurrentProfile, getProfileFullPath, 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 isSubProfile = profileConfig.currentProfile !== 0;
Setting.setConstant('isSubProfile', isSubProfile);
Setting.setConstant('rootProfileDir', rootProfileDir);
Setting.setConstant('profileDir', profileDir);
return {
profileConfig,
profileDir,
isSubProfile,
};
};