Skip to content

Commit

Permalink
fix: 🐛 replace truncate with rm in fs
Browse files Browse the repository at this point in the history
truncate just remove the content of file. should use rm.
  • Loading branch information
huangjien committed Jun 4, 2024
1 parent 35e8dee commit 2f56b7c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Changelog

## [v0.2.20]
## [v0.2.21]

### New Feature

Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "jenkins-log-reader",
"displayName": "jenkins-log-reader",
"description": "read jenkins log, analyse with local AI.",
"version": "0.2.20",
"version": "0.2.21",
"engines": {
"vscode": "^1.89.0"
},
Expand Down Expand Up @@ -138,11 +138,11 @@
"@commitlint/config-conventional": "^19.2.2",
"@types/glob": "^8.0.0",
"@types/mocha": "^10.0.6",
"@types/node": "20.14.0",
"@types/node": "20.14.1",
"@types/vscode": "^1.89.0",
"@types/vscode-webview": "^1.57.5",
"@typescript-eslint/eslint-plugin": "^7.11.0",
"@typescript-eslint/parser": "^7.11.0",
"@typescript-eslint/eslint-plugin": "^7.12.0",
"@typescript-eslint/parser": "^7.12.0",
"@vscode/test-cli": "^0.0.9",
"@vscode/test-electron": "^2.4.0",
"auto-changelog": "^2.4.0",
Expand Down
6 changes: 3 additions & 3 deletions src/panels/JenkinsPanel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export class JenkinsPanel {
<details>
<summary>
<div class="inline-flex items-center justify-between mx-auto m-4 p-4 gap-2 w-full " >
<h1 class="text-xl text-center font-bold mx-8 text-red-600">Jenkins Instance</h1>
<h1 class="text-xl text-center font-bold mx-8 text-inherit">Jenkins Instance</h1>
<vscode-button class="text-xs text-center rounded h-6 w-20 self-center ml-4" id="refresh">Refresh</vscode-button>
</div>
</summary>
Expand Down Expand Up @@ -124,7 +124,7 @@ export class JenkinsPanel {
</details>
<div class="inline-flex items-center justify-between mx-auto m-4 p-4 gap-2 w-full " >
<h2 class="text-xl text-center font-bold mx-8 text-yellow-600">Jobs - Builds</h2>
<h2 class="text-xl text-center font-bold mx-8 text-inherit">Jobs - Builds</h2>
<vscode-button class="text-xs text-center h-6 w-20 self-center rounded" id="batch">Batch</vscode-button>
</div>
<div class="inline-flex flex-wrap gap-1 w-full" >
Expand Down Expand Up @@ -336,7 +336,7 @@ export class JenkinsPanel {

private async writeResolveFile(hash: string, log: any, analysis: any) {
if (fs.existsSync(JenkinsPanel.storagePath + "/analysed/" + hash)) {
fs.truncateSync(JenkinsPanel.storagePath + "/analysed/" + hash);
fs.rmSync(JenkinsPanel.storagePath + "/analysed/" + hash);
}
fs.writeFileSync(
JenkinsPanel.storagePath + "/" + hash,
Expand Down

0 comments on commit 2f56b7c

Please sign in to comment.