Skip to content

Commit

Permalink
Use cross-spawn to run latexindent
Browse files Browse the repository at this point in the history
Related to #1873
  • Loading branch information
jlelong committed Dec 24, 2019
1 parent ccd25da commit 4974dba
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
9 changes: 9 additions & 0 deletions package-lock.json

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

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1644,6 +1644,7 @@
"dependencies": {
"@tamuratak/domstubs": "^0.1.1",
"chokidar": "^3.2.3",
"cross-spawn": "^7.0.1",
"fs-extra": "^5.0.0",
"glob": "^7.1.1",
"iconv-lite": "^0.4.24",
Expand All @@ -1659,6 +1660,7 @@
"ws": "^5.1.1"
},
"devDependencies": {
"@types/cross-spawn": "^6.0.1",
"@types/fs-extra": "^5.0.0",
"@types/glob": "^7.1.1",
"@types/micromatch": "^3.0.0",
Expand All @@ -1674,8 +1676,8 @@
"eslint-plugin-import": "^2.19.1",
"husky": "^3.0.2",
"npm-run-all": "^4.1.5",
"textmate-bailout": "^1.1.0",
"rimraf": "^3.0.0",
"textmate-bailout": "^1.1.0",
"typescript": "~3.7.3",
"vsce": "^1.69.0",
"webpack": "^4.20.2"
Expand Down
3 changes: 2 additions & 1 deletion src/providers/latexformatter.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'
import * as cs from 'cross-spawn'
import * as path from 'path'
import * as fs from 'fs'
import * as os from 'os'
Expand Down Expand Up @@ -141,7 +142,7 @@ export class LaTexFormatter {

this.extension.logger.addLogMessage(`Formatting with command ${this.formatter} ${args}`)
this.extension.manager.setEnvVar()
const worker = cp.spawn(this.formatter, args, { stdio: 'pipe', cwd: path.dirname(document.fileName) })
const worker = cs.spawn(this.formatter, args, { stdio: 'pipe', cwd: path.dirname(document.fileName) })
// handle stdout/stderr
const stdoutBuffer: string[] = []
const stderrBuffer: string[] = []
Expand Down

0 comments on commit 4974dba

Please sign in to comment.