fix: cli -- collection run -- clone request item at start (#3760)

This commit is contained in:
lohit
2025-01-08 21:26:01 +05:30
committed by GitHub
parent 96d6bf1664
commit 3cb15fc001

View File

@@ -1,7 +1,7 @@
const fs = require('fs'); const fs = require('fs');
const chalk = require('chalk'); const chalk = require('chalk');
const path = require('path'); const path = require('path');
const { forOwn } = require('lodash'); const { forOwn, cloneDeep } = require('lodash');
const { exists, isFile, isDirectory } = require('../utils/filesystem'); const { exists, isFile, isDirectory } = require('../utils/filesystem');
const { runSingleRequest } = require('../runner/run-single-request'); const { runSingleRequest } = require('../runner/run-single-request');
const { bruToEnvJson, getEnvVars } = require('../utils/bru'); const { bruToEnvJson, getEnvVars } = require('../utils/bru');
@@ -637,7 +637,7 @@ const handler = async function (argv) {
let currentRequestIndex = 0; let currentRequestIndex = 0;
let nJumps = 0; // count the number of jumps to avoid infinite loops let nJumps = 0; // count the number of jumps to avoid infinite loops
while (currentRequestIndex < bruJsons.length) { while (currentRequestIndex < bruJsons.length) {
const iter = bruJsons[currentRequestIndex]; const iter = cloneDeep(bruJsons[currentRequestIndex]);
const { bruFilepath, bruJson } = iter; const { bruFilepath, bruJson } = iter;
const start = process.hrtime(); const start = process.hrtime();