Skip to content

Commit

Permalink
fix: #25 (#40)
Browse files Browse the repository at this point in the history
  • Loading branch information
aliariff authored Dec 14, 2022
1 parent 7cae8d9 commit 38300e6
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 1 deletion.
41 changes: 41 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,5 +104,8 @@
"semantic-release-vsce": "^5.5.1",
"typescript": "^4.3.2",
"vscode-test": "^1.5.2"
},
"dependencies": {
"is-wsl": "^2.2.0"
}
}
3 changes: 2 additions & 1 deletion src/formatter/htmlbeautifier.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as vscode from "vscode";
import * as cp from "child_process";
const isWsl = require("is-wsl");

export default class HtmlBeautifier {
public format(data: string): Promise<string> {
Expand Down Expand Up @@ -59,7 +60,7 @@ export default class HtmlBeautifier {
const executePath = config.get("executePath", "htmlbeautifier");
const useBundler = config.get("useBundler", false);
const bundlerPath = config.get("bundlerPath", "bundle");
const ext = process.platform === "win32" ? ".bat" : "";
const ext = process.platform === "win32" && !isWsl ? ".bat" : "";
return useBundler ? `${bundlerPath}${ext}` : `${executePath}${ext}`;
}

Expand Down

0 comments on commit 38300e6

Please sign in to comment.