sg: fix nil panic introduced in 284aba024
Created by: mrnugget
Two problems:
- We'd try to build a secrets manager for all commands, even if they didn't have secrets. That would fail if it wasn't configured.
- That error was not surfaced, because we'd do an
if err != nil { return err }
but the previousdefer
would run intonil
-panic by trying to usesc
.
Test plan
-
go run ./dev/sg run github-proxy
failed with nil panic before, now it doesn't.