Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
execute: () => {
return getOpenPath(docManager.services.contents).then(path => {
if (!path) {
return;
}
docManager.services.contents.get(path, { content: false }).then(
args => {
// exists
return commands.execute(CommandIDs.open, { path: path });
},
() => {
// does not exist
return showDialog({
title: 'Cannot open',
body: 'File not found',
buttons: [Dialog.okButton()]
});
}