Skip to content

Commit c1d1cdc

Browse files
author
Jeff Gordon
committed
fix: remove comment lines
1 parent d074410 commit c1d1cdc

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

lib/uv.js

+7-2
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,18 @@ async function uvToRequirements() {
8787
*/
8888
function removeEditableFlagFromRequirementsString(requirementBuffer) {
8989
const flagStr = '-e ';
90+
const commentLine = '# ';
9091
const lines = requirementBuffer.toString('utf8').split(EOL);
92+
const newLines = [];
9193
for (let i = 0; i < lines.length; i++) {
9294
if (lines[i].startsWith(flagStr)) {
93-
lines[i] = lines[i].substring(flagStr.length);
95+
newLines.push(lines[i].substring(flagStr.length));
96+
}
97+
if (!lines[i].startsWith(commentLine)) {
98+
newLines.push(lines[i]);
9499
}
95100
}
96-
return Buffer.from(lines.join(EOL));
101+
return Buffer.from(newLines.join(EOL));
97102
}
98103

99104
module.exports = { uvToRequirements };

0 commit comments

Comments
 (0)