From 62cbf8550c84fed61d4c3571cc852fbd189b965f Mon Sep 17 00:00:00 2001 From: mpl Date: Wed, 11 Dec 2013 00:47:50 +0100 Subject: [PATCH] camput init: use osutil.KeyBlobsDir() Change-Id: I1b9f29c24361ffab708af4bdaff8c870ff8730e6 --- cmd/camput/init.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/cmd/camput/init.go b/cmd/camput/init.go index b6deea015..cccf461ec 100644 --- a/cmd/camput/init.go +++ b/cmd/camput/init.go @@ -34,8 +34,8 @@ import ( ) type initCmd struct { - newKey bool - gpgkey string + newKey bool + gpgkey string noconfig bool } @@ -129,9 +129,10 @@ func (c *initCmd) RunCommand(args []string) error { log.Fatal("--newkey and --gpgkey are mutually exclusive") } - blobDir := path.Join(osutil.CamliConfigDir(), "keyblobs") - os.Mkdir(osutil.CamliConfigDir(), 0700) - os.Mkdir(blobDir, 0700) + blobDir := osutil.KeyBlobsDir() + if err := os.MkdirAll(blobDir, 0700); err != nil { + return err + } var keyId string var err error