Skip to content

Commit 6e1f7b9

Browse files
author
Jeff Gordon
committed
fix: remove comment lines
1 parent 6b4aa83 commit 6e1f7b9

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lib/uv.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,16 +89,16 @@ function removeEditableFlagFromRequirementsString(requirementBuffer) {
8989
const flagStr = '-e ';
9090
const commentLine = '#';
9191
const lines = requirementBuffer.toString('utf8').split(EOL);
92-
const newLines = [];
92+
let updatedLines = [];
9393
for (let i = 0; i < lines.length; i++) {
9494
if (lines[i].startsWith(flagStr)) {
95-
newLines.push(lines[i].substring(flagStr.length));
95+
updatedLines.push(lines[i].substring(flagStr.length));
9696
}
97-
if (lines[i].startsWith(commentLine)) {
98-
continue;
97+
if (!lines[i].startsWith(commentLine)) {
98+
updatedLines.push(lines[i]);
9999
}
100100
}
101-
return Buffer.from(newLines.join(EOL));
101+
return Buffer.from(updatedLines.join(EOL));
102102
}
103103

104104
module.exports = { uvToRequirements };

0 commit comments

Comments
 (0)