2022-04-11 17:49:32 +02:00
|
|
|
import { CommandRuntime, CommandDeclaration, CommandContext } from '@joplin/lib/services/CommandService';
|
2022-04-14 10:58:34 +02:00
|
|
|
import Setting from '@joplin/lib/models/Setting';
|
|
|
|
import { openFileWithExternalEditor } from '@joplin/lib/services/ExternalEditWatcher/utils';
|
2022-04-11 17:49:32 +02:00
|
|
|
import bridge from '../services/bridge';
|
|
|
|
import { _ } from '@joplin/lib/locale';
|
|
|
|
|
|
|
|
export const declaration: CommandDeclaration = {
|
|
|
|
name: 'editProfileConfig',
|
|
|
|
label: () => _('Edit profile configuration...'),
|
|
|
|
};
|
|
|
|
|
|
|
|
export const runtime = (): CommandRuntime => {
|
|
|
|
return {
|
|
|
|
execute: async (_context: CommandContext) => {
|
|
|
|
await openFileWithExternalEditor(`${Setting.value('rootProfileDir')}/profiles.json`, bridge());
|
|
|
|
},
|
|
|
|
enabledCondition: 'hasMultiProfiles',
|
|
|
|
};
|
|
|
|
};
|