mirror of
https://github.com/Microsoft/vscode
synced 2024-09-13 21:55:38 +00:00
Register mkdtemp command
This commit is contained in:
parent
1dd16ab728
commit
e8cb017371
|
@ -10,6 +10,10 @@ import { FileEditorInput } from 'vs/workbench/contrib/files/common/editors/fileE
|
|||
import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors';
|
||||
import { IEditorRegistry, EditorDescriptor, Extensions as EditorExtensions } from 'vs/workbench/browser/editor';
|
||||
import { NativeTextFileEditor } from 'vs/workbench/contrib/files/electron-browser/textFileEditor';
|
||||
import { CommandsRegistry } from 'vs/platform/commands/common/commands';
|
||||
import * as os from 'os';
|
||||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
|
||||
// Register file editor
|
||||
Registry.as<IEditorRegistry>(EditorExtensions.Editors).registerEditor(
|
||||
|
@ -22,3 +26,8 @@ Registry.as<IEditorRegistry>(EditorExtensions.Editors).registerEditor(
|
|||
new SyncDescriptor<EditorInput>(FileEditorInput)
|
||||
]
|
||||
);
|
||||
|
||||
// Register mkdtemp command
|
||||
CommandsRegistry.registerCommand('mkdtemp', function () {
|
||||
return fs.promises.mkdtemp(path.join(os.tmpdir(), 'vscodetmp-'));
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue