Skip to content

Commit 94829f0

Browse files
committed
utf-fix
Signed-off-by: akshat99812 <138353837+akshat99812@users.noreply.github.com>
1 parent ce63243 commit 94829f0

File tree

1 file changed

+34
-1
lines changed

1 file changed

+34
-1
lines changed

src/Utg.ts

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,40 @@ async function Utg(context: vscode.ExtensionContext , additional_prompts?:string
267267
return;
268268
}
269269

270-
// ... rest of the existing code ...
270+
console.log("additional_prompts" , additional_prompts);
271+
if(!additional_prompts){
272+
additional_prompts = "";
273+
}
274+
275+
// Adjust the terminal command to include the test file path
276+
terminal.sendText(`sh "${scriptPath}" "${sourceFilePath}" "${testFilePaths[0]}" "${coverageReportPath}" "${command}" "${additional_prompts}";`);
277+
278+
const delay = (ms: number) => new Promise(resolve => setTimeout(resolve, ms));
279+
280+
// Add a 5-second delay before calling the API
281+
await delay(5000);
282+
283+
try {
284+
if (token) {
285+
apiResponse = await makeApiRequest(token) || 'no response';
286+
const response = JSON.parse(apiResponse);
287+
await context.globalState.update('apiResponse', apiResponse);
288+
if (response.usedCall === response.totalCall) {
289+
await context.globalState.update('SubscriptionEnded', true);
290+
}
291+
} else {
292+
console.log("token not found");
293+
}
294+
} catch (apiError) {
295+
vscode.window.showErrorMessage('Error during API request: ' + apiError);
296+
}
297+
298+
const disposable = vscode.window.onDidCloseTerminal(eventTerminal => {
299+
if (eventTerminal === terminal) {
300+
disposable.dispose();
301+
resolve();
302+
}
303+
});
271304
} catch (error) {
272305
console.log(error);
273306
vscode.window.showErrorMessage('Error occurred Keploy utg: ' + error);

0 commit comments

Comments
 (0)