Skip to content

Commit 53cd77b

Browse files
committed
fix crash when writing output to file
1 parent c020164 commit 53cd77b

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "build-and-run",
33
"displayName": "Build and Run",
44
"description": "Build and Run your code with ease. Pass input from source comments.",
5-
"version": "1.0.1",
5+
"version": "1.0.2",
66
"publisher": "glelesius",
77
"bugs": {
88
"url": "https://github.com/gediminasel/build-and-run-vs/issues",

src/commands.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ export function listenCommandWithOutputAndProgress(command: CommandToSpawn, opti
114114
const outputFilePath = randomFilePath('txt');
115115
outputFile = createWriteStream(outputFilePath, { flags: 'w' });
116116
outputFile.write(outputText);
117+
outputText = "";
117118
if (openOutputFile) {
118119
const openPath = vscode.Uri.parse("file:///" + outputFilePath);
119120
vscode.workspace.openTextDocument(openPath).then(doc => {
@@ -123,7 +124,7 @@ export function listenCommandWithOutputAndProgress(command: CommandToSpawn, opti
123124
output.append("\nFULL OUTPUT IN file:///" + outputFilePath);
124125
}
125126
}
126-
outputFile.write(outputBuffer);
127+
outputFile.write(bufferString);
127128
}
128129
outputBuffer = [];
129130
};

0 commit comments

Comments
 (0)