mirror of
https://github.com/James-Yu/LaTeX-Workshop.git
synced 2024-10-04 07:07:54 +03:00
Delete temp files
This commit is contained in:
parent
1737f48e1e
commit
37d560365d
@ -8,6 +8,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
|
||||
### Added
|
||||
- (#39) LaTeX linting with `chktex`.
|
||||
|
||||
### Changed
|
||||
- Web page title will show `[disconnected]` when the websocket is closed.
|
||||
- Such web pages cannot communicate with the extension. Thus will not auto refresh or SyncTeX.
|
||||
- Temp files created by log parser will be automatically deleted. In most cases.
|
||||
|
||||
## [1.0.2] - 2017-03-26
|
||||
### Fixed
|
||||
- (#38) Cope with typical language ids.
|
||||
|
@ -23,7 +23,7 @@ export class Linter {
|
||||
if (this.currentProcess)
|
||||
this.currentProcess.kill()
|
||||
this.extension.logger.addLogMessage(`Linter start.`)
|
||||
if (vscode.window.activeTextEditor.document.fileName === this.extension.manager.rootFile) {
|
||||
if (vscode.window.activeTextEditor.document.fileName !== this.extension.manager.rootFile) {
|
||||
let configuration = vscode.workspace.getConfiguration('latex-workshop')
|
||||
let command = (configuration.get('linter_command') as string).replace('%DOC%', `"${this.extension.manager.rootFile}"`)
|
||||
this.lintCommand(command, this.extension.manager.rootFile)
|
||||
@ -48,6 +48,11 @@ export class Linter {
|
||||
if (!error) {
|
||||
this.extension.parser.parseLinter(stdout.split(fileName).join(this.extension.manager.rootFile))
|
||||
this.extension.logger.addLogMessage(`Linter finished.`)
|
||||
if (fileName !== this.extension.manager.rootFile) {
|
||||
console.log(fileName)
|
||||
fs.unlink(fileName)
|
||||
this.extension.logger.addLogMessage(`Temp file removed: ${fileName}`)
|
||||
}
|
||||
return
|
||||
}
|
||||
this.extension.logger.addLogMessage(`Linter failed with error ${error.message}.`)
|
||||
|
@ -150,6 +150,10 @@ export class Parser {
|
||||
diagsCollection[item.file].push(diag)
|
||||
}
|
||||
if (createBuildLogRaw) {
|
||||
if (this.buildLogFile) {
|
||||
fs.unlink(this.buildLogFile.name)
|
||||
this.extension.logger.addLogMessage(`Temp file removed: ${this.buildLogFile.name}`)
|
||||
}
|
||||
this.buildLogFile = tmp.fileSync()
|
||||
fs.writeFileSync(this.buildLogFile.fd, this.buildLogRaw)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user