Skip to content

Commit

Permalink
expose cwd in frontmatter (#278)
Browse files Browse the repository at this point in the history
  • Loading branch information
mxsdev authored May 30, 2023
1 parent d89e2e2 commit d0aa533
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 41 deletions.
1 change: 1 addition & 0 deletions internal/api/runme/parser/v1/parser.proto
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ message Cell {

message Frontmatter {
string shell = 1;
string cwd = 2;
}

message DeserializeRequest {
Expand Down
1 change: 1 addition & 0 deletions internal/document/frontmatter.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,5 +69,6 @@ func ParseFrontmatter(raw string) (f Frontmatter, info FrontmatterParseInfo) {
func (fmtr Frontmatter) ToParser() *parserv1.Frontmatter {
return &parserv1.Frontmatter{
Shell: fmtr.Shell,
Cwd: fmtr.Cwd,
}
}
89 changes: 49 additions & 40 deletions internal/gen/proto/go/runme/parser/v1/parser.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions internal/gen/proto/ts/runme/parser/v1/parser_pb.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ export interface Frontmatter {
* @generated from protobuf field: string shell = 1;
*/
shell: string;
/**
* @generated from protobuf field: string cwd = 2;
*/
cwd: string;
}
/**
* @generated from protobuf message runme.parser.v1.DeserializeRequest
Expand Down
3 changes: 2 additions & 1 deletion internal/gen/proto/ts/runme/parser/v1/parser_pb.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ export const Cell = new Cell$Type();
class Frontmatter$Type extends MessageType {
constructor() {
super("runme.parser.v1.Frontmatter", [
{ no: 1, name: "shell", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
{ no: 1, name: "shell", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
{ no: 2, name: "cwd", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
]);
}
}
Expand Down
6 changes: 6 additions & 0 deletions internal/gen/proto/ts/runme/parser/v1/parser_pb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,11 @@ export class Frontmatter extends Message<Frontmatter> {
*/
shell = "";

/**
* @generated from field: string cwd = 2;
*/
cwd = "";

constructor(data?: PartialMessage<Frontmatter>) {
super();
proto3.util.initPartial(data, this);
Expand All @@ -203,6 +208,7 @@ export class Frontmatter extends Message<Frontmatter> {
static readonly typeName = "runme.parser.v1.Frontmatter";
static readonly fields: FieldList = proto3.util.newFieldList(() => [
{ no: 1, name: "shell", kind: "scalar", T: 9 /* ScalarType.STRING */ },
{ no: 2, name: "cwd", kind: "scalar", T: 9 /* ScalarType.STRING */ },
]);

static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): Frontmatter {
Expand Down

0 comments on commit d0aa533

Please sign in to comment.