From 22b6e21cbb304403d8ce9d14060c6a876cf2c0e8 Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Tue, 1 Mar 2016 14:54:26 +0100 Subject: Cleanup file operations --- solve_webroot.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'solve_webroot.go') diff --git a/solve_webroot.go b/solve_webroot.go index dc3c878..096ca4a 100644 --- a/solve_webroot.go +++ b/solve_webroot.go @@ -19,7 +19,11 @@ func NewWebrootSolver(webroot string) Solver { func (s *webrootSolver) Solve(ch Challenge) error { s.file = path.Join(s.webroot, WellKnown, ch.Token) log.Println("solve webroot", s.file) - fd, err := CreatePubFile(s.file) + err := os.MkdirAll(path.Dir(s.file), 0755) + if err != nil { + return err + } + fd, err := CreateFile(s.file, 0644) if err != nil { return err } -- cgit v1.2.3