mirror of
https://github.com/laurent22/joplin.git
synced 2024-12-24 10:27:10 +02:00
20 lines
715 B
TypeScript
20 lines
715 B
TypeScript
|
import { CommandRuntime, CommandDeclaration, CommandContext } from '@joplin/lib/services/CommandService';
|
||
|
import Setting from '../../lib/models/Setting';
|
||
|
import { openFileWithExternalEditor } from '../../lib/services/ExternalEditWatcher/utils';
|
||
|
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',
|
||
|
};
|
||
|
};
|