From 76fa9fc0f9b17c1be5c59c86b15145f7ff31788e Mon Sep 17 00:00:00 2001 From: Johan Thomsen Date: Sat, 27 Apr 2019 22:27:55 +0200 Subject: [PATCH] gcroot: addressing review comments - replaced fmt.sprintf with filepath.join - fixed directory permission bits --- nix/nix.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/nix/nix.go b/nix/nix.go index 2ddd73a..ae2def5 100644 --- a/nix/nix.go +++ b/nix/nix.go @@ -140,12 +140,9 @@ func (ctx *NixContext) BuildMachines(deploymentPath string, hosts []Host, nixArg } hostsArg += "]" - resultLinkPath := - fmt.Sprintf("%s/.gcroots/%s", - path.Dir(deploymentPath), - path.Base(deploymentPath)) + resultLinkPath := filepath.Join(path.Dir(deploymentPath), ".gcroots", path.Base(deploymentPath)) if ctx.KeepGCRoot { - if err = os.MkdirAll(path.Dir(resultLinkPath), 755) ; err != nil { + if err = os.MkdirAll(path.Dir(resultLinkPath), 0755) ; err != nil { ctx.KeepGCRoot = false; fmt.Fprintf(os.Stderr, "Unable to create GC root, skipping: %s", err) }