mirror of
https://github.com/laurent22/joplin.git
synced 2024-11-30 08:26:59 +02:00
Plugins: Added revealResourceFile command
This commit is contained in:
parent
d0b969372d
commit
6e6432bfee
@ -313,6 +313,9 @@ packages/app-desktop/gui/MainScreen/commands/renameFolder.js.map
|
|||||||
packages/app-desktop/gui/MainScreen/commands/renameTag.d.ts
|
packages/app-desktop/gui/MainScreen/commands/renameTag.d.ts
|
||||||
packages/app-desktop/gui/MainScreen/commands/renameTag.js
|
packages/app-desktop/gui/MainScreen/commands/renameTag.js
|
||||||
packages/app-desktop/gui/MainScreen/commands/renameTag.js.map
|
packages/app-desktop/gui/MainScreen/commands/renameTag.js.map
|
||||||
|
packages/app-desktop/gui/MainScreen/commands/revealResourceFile.d.ts
|
||||||
|
packages/app-desktop/gui/MainScreen/commands/revealResourceFile.js
|
||||||
|
packages/app-desktop/gui/MainScreen/commands/revealResourceFile.js.map
|
||||||
packages/app-desktop/gui/MainScreen/commands/search.d.ts
|
packages/app-desktop/gui/MainScreen/commands/search.d.ts
|
||||||
packages/app-desktop/gui/MainScreen/commands/search.js
|
packages/app-desktop/gui/MainScreen/commands/search.js
|
||||||
packages/app-desktop/gui/MainScreen/commands/search.js.map
|
packages/app-desktop/gui/MainScreen/commands/search.js.map
|
||||||
|
3
.gitignore
vendored
3
.gitignore
vendored
@ -303,6 +303,9 @@ packages/app-desktop/gui/MainScreen/commands/renameFolder.js.map
|
|||||||
packages/app-desktop/gui/MainScreen/commands/renameTag.d.ts
|
packages/app-desktop/gui/MainScreen/commands/renameTag.d.ts
|
||||||
packages/app-desktop/gui/MainScreen/commands/renameTag.js
|
packages/app-desktop/gui/MainScreen/commands/renameTag.js
|
||||||
packages/app-desktop/gui/MainScreen/commands/renameTag.js.map
|
packages/app-desktop/gui/MainScreen/commands/renameTag.js.map
|
||||||
|
packages/app-desktop/gui/MainScreen/commands/revealResourceFile.d.ts
|
||||||
|
packages/app-desktop/gui/MainScreen/commands/revealResourceFile.js
|
||||||
|
packages/app-desktop/gui/MainScreen/commands/revealResourceFile.js.map
|
||||||
packages/app-desktop/gui/MainScreen/commands/search.d.ts
|
packages/app-desktop/gui/MainScreen/commands/search.d.ts
|
||||||
packages/app-desktop/gui/MainScreen/commands/search.js
|
packages/app-desktop/gui/MainScreen/commands/search.js
|
||||||
packages/app-desktop/gui/MainScreen/commands/search.js.map
|
packages/app-desktop/gui/MainScreen/commands/search.js.map
|
||||||
|
@ -17,6 +17,7 @@ import * as openTag from './openTag';
|
|||||||
import * as print from './print';
|
import * as print from './print';
|
||||||
import * as renameFolder from './renameFolder';
|
import * as renameFolder from './renameFolder';
|
||||||
import * as renameTag from './renameTag';
|
import * as renameTag from './renameTag';
|
||||||
|
import * as revealResourceFile from './revealResourceFile';
|
||||||
import * as search from './search';
|
import * as search from './search';
|
||||||
import * as setTags from './setTags';
|
import * as setTags from './setTags';
|
||||||
import * as showModalMessage from './showModalMessage';
|
import * as showModalMessage from './showModalMessage';
|
||||||
@ -54,6 +55,7 @@ const index:any[] = [
|
|||||||
print,
|
print,
|
||||||
renameFolder,
|
renameFolder,
|
||||||
renameTag,
|
renameTag,
|
||||||
|
revealResourceFile,
|
||||||
search,
|
search,
|
||||||
setTags,
|
setTags,
|
||||||
showModalMessage,
|
showModalMessage,
|
||||||
|
@ -0,0 +1,20 @@
|
|||||||
|
import { CommandRuntime, CommandDeclaration, CommandContext } from '@joplin/lib/services/CommandService';
|
||||||
|
import { _ } from '@joplin/lib/locale';
|
||||||
|
import Resource from '@joplin/lib/models/Resource';
|
||||||
|
import bridge from '../../../services/bridge';
|
||||||
|
|
||||||
|
export const declaration: CommandDeclaration = {
|
||||||
|
name: 'revealResourceFile',
|
||||||
|
label: _('Reveal file in folder'),
|
||||||
|
};
|
||||||
|
|
||||||
|
export const runtime = (): CommandRuntime => {
|
||||||
|
return {
|
||||||
|
execute: async (_context: CommandContext, itemId: string) => {
|
||||||
|
const resource = await Resource.load(itemId);
|
||||||
|
if (!resource) throw new Error(`No such resource: ${itemId}`);
|
||||||
|
const fullPath = Resource.fullPath(resource);
|
||||||
|
bridge().showItemInFolder(fullPath);
|
||||||
|
},
|
||||||
|
};
|
||||||
|
};
|
Loading…
Reference in New Issue
Block a user