Skip to content

Commit

Permalink
fix #217
Browse files Browse the repository at this point in the history
  • Loading branch information
junstyle committed Aug 14, 2024
1 parent 21a0323 commit 165774b
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 9 deletions.
5 changes: 1 addition & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18265,9 +18265,6 @@ function runAsync(command, args, options, onData = null) {
if (command.includes(" ") && command[0] != '"') {
command = '"' + command + '"';
}
for (let i = 0; i < args.length; i++) {
args[i] = args[i].replace(/"/g, '\\"');
}
}
output("runAsync: spawn " + command);
output(JSON.stringify(args, null, 2));
Expand Down Expand Up @@ -18458,7 +18455,7 @@ var PHPCSFixer = class extends PHPCSFixerConfig {
}
}
if (!useConfig && this.rules) {
args.push("--rules=" + this.rules);
args.push('--rules="' + this.rules.replace(/"/g, '\\"') + '"');
}
if (this.allowRisky) {
args.push("--allow-risky=yes");
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "php-cs-fixer",
"displayName": "php cs fixer",
"description": "PHP CS Fixer extension for VS Code, php formatter, php code beautify tool, format html",
"version": "0.3.16",
"version": "0.3.17",
"publisher": "junstyle",
"author": "junstyle",
"license": "ISC",
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ class PHPCSFixer extends PHPCSFixerConfig {
}
}
if (!useConfig && this.rules) {
args.push('--rules=' + this.rules)
args.push('--rules="' + (this.rules as string).replace(/"/g, "\\\"") + '"')
}
if (this.allowRisky) {
args.push('--allow-risky=yes')
Expand Down
3 changes: 0 additions & 3 deletions src/runAsync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ export function runAsync(command: string, args: string[], options: SpawnOptionsW
if (command.includes(" ") && command[0] != '"') {
command = '"' + command + '"'
}
for (let i = 0; i < args.length; i++) {
args[i] = args[i].replace(/"/g, "\\\"")
}
}

output('runAsync: spawn ' + command);
Expand Down

0 comments on commit 165774b

Please sign in to comment.