Skip to content

Commit 215c0c4

Browse files
committed
Include line number in readme output
Signed-off-by: Luis Mastrangelo <luis@swirldslabs.com>
1 parent 91a261f commit 215c0c4

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

scripts/readme.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ function main() {
2222
let output = '';
2323
const write = (/** @type string */ line) => (output += line + '\n');
2424

25+
let lineNum = 0;
2526
for (const line of readme.split('\n')) {
27+
lineNum++;
2628
const trimmedLine = line.trimEnd();
2729
const found = MARKERS.map(marker => ({
2830
...marker,
@@ -31,7 +33,9 @@ function main() {
3133
if (found !== undefined && marker === null) {
3234
assert(found.match !== null);
3335
marker = { line: trimmedLine, file: found.match[1], end: found.end };
34-
process.stdout.write(`Opening marker ${c.magenta(marker.file)} .. `);
36+
process.stdout.write(
37+
`${c.blue(`[Line ${lineNum}]`)} Opening marker ${c.magenta(marker.file)} .. `
38+
);
3539
} else if (marker !== null && trimmedLine === marker.end) {
3640
write(marker.line);
3741
let content;

0 commit comments

Comments
 (0)