Add skip daemon flag and send recently authed tokens to daemon (#3883)

* Add skip daemon flag and send recently authed tokens to daemon

* Rename flag skip-daemon to skip-cache-daemon

* adding option test

* move common.Options to base.Option

* SocketAddress returns *url.URL, fix search test
This commit is contained in:
Todd authored and Johan Brandhorst-Satzkorn committed 2024-01-05 07:43:20 -08:00
1 parent 2f7459fa40
commit 3a7ea64a31
27 files changed
+429 -419

No files matched your search

@@ -69,12 +69,15 @@ func (s *StopCommand) stop(ctx context.Context) error {
func stopThroughHandler(ctx context.Context, dotPath string) (*api.Error, error) {
const op = "daemon.stopThroughHandler"
sockAddr := daemon.SocketAddress(dotPath)
sockAddr, err := daemon.SocketAddress(dotPath)
if err != nil {
return nil, errors.Wrap(ctx, err, op)
}
client, err := api.NewClient(nil)
if err != nil {
return nil, errors.Wrap(ctx, err, op)
}
if err := client.SetAddr(sockAddr); err != nil {
if err := client.SetAddr(sockAddr.String()); err != nil {
return nil, errors.Wrap(ctx, err, op)
}
// Because this is using the real lib it can pick up from stored locations