Skip to content

Commit

Permalink
Fix #1383
Browse files Browse the repository at this point in the history
  • Loading branch information
octref committed Aug 12, 2019
1 parent a6edf91 commit 8916640
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

### 0.22.1

- Fix command "Open user scaffold snippet folder" failure when the global snippet dir doens't exist yet. #1383.

### 0.22.0 | 2019-08-09 | [VSIX](https://marketplace.visualstudio.com/_apis/public/gallery/publishers/octref/vsextensions/vetur/0.22.0/vspackage)

- New Scaffold Snippets system that allows system / workspace level customizable snippets. See details in [snippet docs](https://vuejs.github.io/vetur/snippet.html). #1151.
Expand Down
6 changes: 6 additions & 0 deletions client/commands/openUserScaffoldSnippetFolderCommand.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
import * as vscode from 'vscode';
import * as fs from 'fs';

export function generateOpenUserScaffoldSnippetFolderCommand(globalSnippetDir: string) {
return async () => {
const uri = vscode.Uri.file(globalSnippetDir);

if (!fs.existsSync(uri.fsPath)) {
fs.mkdirSync(uri.fsPath);
}

vscode.commands.executeCommand('vscode.openFolder', uri, true);
};
}

0 comments on commit 8916640

Please sign in to comment.