From 6e1f7b9e55de6efaa27fec4a98f472701381438b Mon Sep 17 00:00:00 2001 From: Jeff Gordon Date: Tue, 1 Oct 2024 23:16:06 -0500 Subject: [PATCH] fix: remove comment lines --- lib/uv.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/uv.js b/lib/uv.js index c53bc294..7a814cd5 100644 --- a/lib/uv.js +++ b/lib/uv.js @@ -89,16 +89,16 @@ function removeEditableFlagFromRequirementsString(requirementBuffer) { const flagStr = '-e '; const commentLine = '#'; const lines = requirementBuffer.toString('utf8').split(EOL); - const newLines = []; + let updatedLines = []; for (let i = 0; i < lines.length; i++) { if (lines[i].startsWith(flagStr)) { - newLines.push(lines[i].substring(flagStr.length)); + updatedLines.push(lines[i].substring(flagStr.length)); } - if (lines[i].startsWith(commentLine)) { - continue; + if (!lines[i].startsWith(commentLine)) { + updatedLines.push(lines[i]); } } - return Buffer.from(newLines.join(EOL)); + return Buffer.from(updatedLines.join(EOL)); } module.exports = { uvToRequirements };