mirror of
https://code.blicky.net/yorhel/ncdu.git
synced 2026-01-13 01:08:41 -09:00
Fix JSON export of special entries
This commit is contained in:
parent
2b2b4473e5
commit
dc42c91619
1 changed files with 5 additions and 5 deletions
10
src/sink.zig
10
src/sink.zig
|
|
@ -168,11 +168,11 @@ const JsonWriter = struct {
|
||||||
};
|
};
|
||||||
ctx.write(if (isdir) ",\n[{\"name\":\"" else ",\n{\"name\":\"");
|
ctx.write(if (isdir) ",\n[{\"name\":\"" else ",\n{\"name\":\"");
|
||||||
ctx.writeStr(name);
|
ctx.writeStr(name);
|
||||||
ctx.writeStr(switch (t) {
|
ctx.write(switch (t) {
|
||||||
.err => "\",\"read_error\":true",
|
.err => "\",\"read_error\":true}",
|
||||||
.other_fs => "\",\"excluded\":\"othfs\"",
|
.other_fs => "\",\"excluded\":\"othfs\"}",
|
||||||
.kernfs => "\",\"excluded\":\"kernfs\"",
|
.kernfs => "\",\"excluded\":\"kernfs\"}",
|
||||||
.excluded => "\",\"excluded\":\"pattern\"",
|
.excluded => "\",\"excluded\":\"pattern\"}",
|
||||||
});
|
});
|
||||||
if (isdir) ctx.writeByte(']');
|
if (isdir) ctx.writeByte(']');
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue