Skip to content

Commit

Permalink
Fix publish default file name
Browse files Browse the repository at this point in the history
JennieJi committed Apr 20, 2020
1 parent 1b4bf9a commit d241bc8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/publishSnippet.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import * as path from 'path';
import { window, Memento } from 'vscode';
import SnippetRegistry from './SnippetRegistry';
import addHost from './addHost';
@@ -31,10 +32,11 @@ export default async function publish(state: Memento) {
}
api = new SnippetRegistry(hostConfig);
}
const activeEditorPath = activeTextEditor.document.fileName;
const fileName = await window.showInputBox({
ignoreFocusOut: true,
prompt: 'Enter file name with extention. E.g., "example.js".',
value: activeTextEditor.document.fileName,
value: activeEditorPath ? path.basename(activeEditorPath) : undefined,
});
if (!fileName) {
return;

0 comments on commit d241bc8

Please sign in to comment.