mirror of
https://github.com/Kong/insomnia.git
synced 2026-08-04 11:52:33 -04:00
remove append file adapter
This commit is contained in:
@@ -521,7 +521,7 @@ const tryToExecuteScript = async (context: RequestAndContextAndOptionalResponse)
|
||||
const fn =
|
||||
process.type === 'renderer'
|
||||
? runScriptConcurrently
|
||||
: (require(/* @vite-ignore */ '../script-executor') as typeof ScriptExecutorModule).runScript;
|
||||
: (require('../script-executor') as typeof ScriptExecutorModule).runScript;
|
||||
const output = await fn({
|
||||
script,
|
||||
context: {
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import fs from 'node:fs';
|
||||
|
||||
import * as _ from 'es-toolkit/compat';
|
||||
|
||||
import { initInsomniaObject, InsomniaObject } from '../../insomnia-scripting-environment/src/objects';
|
||||
@@ -65,7 +67,7 @@ export const runScript = async ({
|
||||
const updatedCertificates = mergeClientCertificates(context.clientCertificates, mutatedContextObject.request);
|
||||
const updatedCookieJar = mergeCookieJar(context.cookieJar, mutatedContextObject.cookieJar);
|
||||
|
||||
await appendScriptLogs(context.timelinePath, scriptConsole.dumpLogs());
|
||||
await fs.promises.appendFile(context.timelinePath, scriptConsole.dumpLogs());
|
||||
|
||||
// console.log('mutatedInsomniaObject', mutatedContextObject);
|
||||
// console.log('context', context);
|
||||
@@ -119,12 +121,3 @@ function proxiedSetTimeout(callback: () => void, ms?: number | undefined) {
|
||||
resolveHdl(null);
|
||||
}, ms);
|
||||
}
|
||||
|
||||
async function appendScriptLogs(timelinePath: string, data: string) {
|
||||
if (process.type === 'renderer') {
|
||||
return window.main.timeline.appendToFile({ timelinePath, data });
|
||||
}
|
||||
|
||||
const { appendFile } = require('node:fs/promises');
|
||||
return appendFile(timelinePath, data);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user