|
@@ -448,15 +448,17 @@ function addCommands(
|
|
|
});
|
|
|
|
|
|
commands.addCommand(CommandIDs.openPath, {
|
|
|
- label: 'Open From Path…',
|
|
|
- caption: 'Open from path',
|
|
|
- execute: async () => {
|
|
|
- let { value: path } = await InputDialog.getText({
|
|
|
- label: 'Path',
|
|
|
- placeholder: '/path/relative/to/jlab/root',
|
|
|
- title: 'Open Path',
|
|
|
- okLabel: 'Open'
|
|
|
- });
|
|
|
+ label: args => (args.path ? `Open ${args.path}` : 'Open From Path…'),
|
|
|
+ caption: args => (args.path ? `Open ${args.path}` : 'Open from path'),
|
|
|
+ execute: async ({ path }: { path?: string }) => {
|
|
|
+ if (!path) {
|
|
|
+ path = (await InputDialog.getText({
|
|
|
+ label: 'Path',
|
|
|
+ placeholder: '/path/relative/to/jlab/root',
|
|
|
+ title: 'Open Path',
|
|
|
+ okLabel: 'Open'
|
|
|
+ })).value;
|
|
|
+ }
|
|
|
if (!path) {
|
|
|
return;
|
|
|
}
|