MCPcopy Create free account
hub / github.com/PerpetualSoftware/pad / writeCredsFile

Function writeCredsFile

internal/cli/credentials_test.go:21–32  ·  view source on GitHub ↗
(t *testing.T, home, body string)

Source from the content-addressed store, hash-verified

19}
20
21func writeCredsFile(t *testing.T, home, body string) string {
22 t.Helper()
23 dir := filepath.Join(home, ".pad")
24 if err := os.MkdirAll(dir, 0755); err != nil {
25 t.Fatalf("mkdir ~/.pad: %v", err)
26 }
27 path := filepath.Join(dir, "credentials.json")
28 if err := os.WriteFile(path, []byte(body), 0600); err != nil {
29 t.Fatalf("write credentials: %v", err)
30 }
31 return path
32}
33
34// readCredsFile returns the on-disk JSON of credentials.json. Used to
35// assert post-Save behavior — confirms the v2 format actually lands on

Calls 1

JoinMethod · 0.80

Tested by

no test coverage detected