Skip to content

Commit adb31d8

Browse files
authored
fix: create certguard directory if it not exists (#117)
Issue: #116
1 parent fea1567 commit adb31d8

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

cmd/root.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,14 @@ func runInteractiveCertGuard(cmd *cobra.Command, args []string) error {
5757
return err
5858
}
5959

60+
if _, err := os.Stat(cacheDir); os.IsNotExist(err) {
61+
err := os.MkdirAll(cacheDir, 0o775)
62+
if err != nil {
63+
fmt.Println("fatal:", err)
64+
os.Exit(1)
65+
}
66+
}
67+
6068
dbConnection, err := db.NewDBConnection(cacheDir)
6169
if err != nil {
6270
return err

0 commit comments

Comments
 (0)