Skip to content

Commit

Permalink
goat: make fmt, and resolution mode for just the DID (#887)
Browse files Browse the repository at this point in the history
  • Loading branch information
bnewbold authored Dec 23, 2024
2 parents 82305ef + a0d0ac2 commit c130614
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
4 changes: 2 additions & 2 deletions cmd/goat/blob.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ var cmdBlob = &cli.Command{
Usage: "directory to store blobs in",
},
&cli.StringFlag{
Name: "pds-host",
Usage: "URL of the PDS to export blobs from (overrides DID doc)",
Name: "pds-host",
Usage: "URL of the PDS to export blobs from (overrides DID doc)",
},
},
Action: runBlobExport,
Expand Down
22 changes: 20 additions & 2 deletions cmd/goat/identity.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,13 @@ var cmdResolve = &cli.Command{
Name: "resolve",
Usage: "lookup identity metadata",
ArgsUsage: `<at-identifier>`,
Flags: []cli.Flag{},
Action: runResolve,
Flags: []cli.Flag{
&cli.BoolFlag{
Name: "did",
Usage: "just resolve to DID",
},
},
Action: runResolve,
}

func runResolve(cctx *cli.Context) error {
Expand All @@ -33,11 +38,20 @@ func runResolve(cctx *cli.Context) error {
dir := identity.BaseDirectory{}
var doc *identity.DIDDocument

if cctx.Bool("did") {
if atid.IsDID() {
}
}

if atid.IsDID() {
did, err := atid.AsDID()
if err != nil {
return err
}
if cctx.Bool("did") {
fmt.Println(did)
return nil
}
doc, err = dir.ResolveDID(ctx, did)
if err != nil {
return err
Expand All @@ -51,6 +65,10 @@ func runResolve(cctx *cli.Context) error {
if err != nil {
return err
}
if cctx.Bool("did") {
fmt.Println(did)
return nil
}
doc, err = dir.ResolveDID(ctx, did)
if err != nil {
return err
Expand Down

0 comments on commit c130614

Please sign in to comment.