Skip to content

Commit

Permalink
error logging - see #3 (comment)
Browse files Browse the repository at this point in the history
  • Loading branch information
NomarCub committed Oct 5, 2021
1 parent ee60435 commit 32c9f66
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

This plugin for [Obsidian](https://obsidian.md/) makes a ribbon button and a command to open your vault as a Visual Studio Code workspace.

It's functionality is probably made redundant now using the [Shell commands](https://github.com/Taitava/obsidian-shellcommands) and [Customizable Sidebar](https://github.com/phibr0/obsidian-customizable-sidebar) (or [Buttons](https://github.com/shabegom/buttons)) plugins, but it'll be maintained for the foreseeable future.

You can use VSCode for various purposes with your vault, such as for git version control, markdown formatting with [Prettier](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode), linting with [markdownlint](https://marketplace.visualstudio.com/items?itemName=DavidAnson.vscode-markdownlint), [mass formatting files](https://marketplace.visualstudio.com/items?itemName=jbockle.jbockle-format-files) and more.

![video showcase](https://user-images.githubusercontent.com/5298006/125867690-c11f4396-e31b-4232-9ea5-822bf729df9a.gif)
Expand Down
6 changes: 5 additions & 1 deletion main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@ export default class OpenVSCode extends Plugin {
const { exec } = require("child_process");
const template = this.settings.executeTemplate.trim() === "" ? DEFAULT_SETTINGS.executeTemplate : this.settings.executeTemplate;
const command = template.replace("{{vaultpath}}", path);
exec(command);
exec(command, (error: any, stdout: any, stderr: any) => {
if (error) {
console.error(`exec error: ${error}`);
}
});
}
}

Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "open-vscode",
"name": "Open vault in VSCode",
"version": "1.1.1",
"version": "1.1.2",
"minAppVersion": "0.11.13",
"description": "Ribbon button and command to open vault as a Visual Studio Code workspace",
"author": "NomarCub",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "open-vscode",
"version": "1.1.1",
"version": "1.1.2",
"description": "Open vault in Visual Studio Code ribbon button and command for Obsidian (https://obsidian.md)",
"main": "main.js",
"scripts": {
Expand Down

0 comments on commit 32c9f66

Please sign in to comment.