Skip to content

Commit ee4b940

Browse files
committed
Change order of arguments in command executed
Should be "qmlformat [options] arguments" with "arguments" being the files to format, and "options" being "-i" and other optional flags.
1 parent b12a3bf commit ee4b940

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: src/formatter.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export const runQmlFormatter = async (command: string, args: readonly string[],
4141
// We must format the file in-place and not rely on stdout.
4242
// For one thing, "\n" outputed by "qmlformat" would be transformed to "\r\n" on Windows, which causes problems with "NewlineType=windows" option.
4343
// Secondly, the "execFile" buffer size is limited (~1MB by default), so it's not reliable enough to use it.
44-
child_process.execFile(command, ["-i", tempFilePath].concat(args), (execError, execStdout, execStderr) => {
44+
child_process.execFile(command, ["-i", ...args, tempFilePath], (execError, execStdout, execStderr) => {
4545
fs.readFile(tempFilePath, { "encoding": "utf8" }, (readError, readData) => {
4646
fs.unlink(tempFilePath, (unlinkError) => {
4747
if (execStdout) {

0 commit comments

Comments
 (0)