Skip to content

Commit

Permalink
fix: remove comment lines
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeff Gordon committed Oct 2, 2024
1 parent 6b4aa83 commit 6e1f7b9
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/uv.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 };

0 comments on commit 6e1f7b9

Please sign in to comment.