From 55df0a7e15bf688ff347e88261ebfcd0f7d9ce19 Mon Sep 17 00:00:00 2001 From: Nick Gerakines <12125+ngerakines@users.noreply.github.com> Date: Thu, 19 Dec 2024 08:38:59 -0500 Subject: [PATCH 1/3] feature: Added --pds-host argument to blob export --- cmd/goat/blob.go | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/cmd/goat/blob.go b/cmd/goat/blob.go index e9422089d..0a1e2ebb8 100644 --- a/cmd/goat/blob.go +++ b/cmd/goat/blob.go @@ -28,6 +28,11 @@ var cmdBlob = &cli.Command{ Aliases: []string{"o"}, Usage: "directory to store blobs in", }, + &cli.StringFlag{ + Name: "pds-host", + Usage: "URL of the PDS to export blobs from (overrides DID doc)", + EnvVars: []string{"ATP_PDS_HOST"}, + }, }, Action: runBlobExport, }, @@ -73,9 +78,14 @@ func runBlobExport(cctx *cli.Context) error { return err } + pds_host := cctx.String("pds-host") + if pds_host == "" { + pds_host = ident.PDSEndpoint() + } + // create a new API client to connect to the account's PDS xrpcc := xrpc.Client{ - Host: ident.PDSEndpoint(), + Host: pds_host,, } if xrpcc.Host == "" { return fmt.Errorf("no PDS endpoint for identity") From b7bd2ee4569cf267eee076a8b1fa898f59a32e8c Mon Sep 17 00:00:00 2001 From: Nick Gerakines <12125+ngerakines@users.noreply.github.com> Date: Thu, 19 Dec 2024 08:43:02 -0500 Subject: [PATCH 2/3] refactor: Updating variables to follow convention --- cmd/goat/blob.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/goat/blob.go b/cmd/goat/blob.go index 0a1e2ebb8..619c736de 100644 --- a/cmd/goat/blob.go +++ b/cmd/goat/blob.go @@ -78,14 +78,14 @@ func runBlobExport(cctx *cli.Context) error { return err } - pds_host := cctx.String("pds-host") - if pds_host == "" { - pds_host = ident.PDSEndpoint() + pdsHost := cctx.String("pds-host") + if pdsHost == "" { + pdsHost = ident.PDSEndpoint() } // create a new API client to connect to the account's PDS xrpcc := xrpc.Client{ - Host: pds_host,, + Host: pdsHost, } if xrpcc.Host == "" { return fmt.Errorf("no PDS endpoint for identity") From 39439f445d615ba5d131def704be9ef7b10e699f Mon Sep 17 00:00:00 2001 From: Nick Gerakines <12125+ngerakines@users.noreply.github.com> Date: Thu, 19 Dec 2024 13:27:23 -0500 Subject: [PATCH 3/3] refactor: Removing env variable because it is a bit ambiguous --- cmd/goat/blob.go | 1 - 1 file changed, 1 deletion(-) diff --git a/cmd/goat/blob.go b/cmd/goat/blob.go index 619c736de..dc10cc738 100644 --- a/cmd/goat/blob.go +++ b/cmd/goat/blob.go @@ -31,7 +31,6 @@ var cmdBlob = &cli.Command{ &cli.StringFlag{ Name: "pds-host", Usage: "URL of the PDS to export blobs from (overrides DID doc)", - EnvVars: []string{"ATP_PDS_HOST"}, }, }, Action: runBlobExport,