From 473e3f8544915a35b3a45c548743978b34e5310e Mon Sep 17 00:00:00 2001 From: Cole Helbling Date: Tue, 2 Mar 2021 00:24:00 -0800 Subject: [PATCH] version-gen: don't use unnecessary constants This prevents the tool from being built with Nix, because this project doesn't use Go modules (or something; I'm not really familiar with Go, much less Go + Nix). --- agent/version/versiongenerator/version-gen.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/agent/version/versiongenerator/version-gen.go b/agent/version/versiongenerator/version-gen.go index d710effc..55c9a001 100644 --- a/agent/version/versiongenerator/version-gen.go +++ b/agent/version/versiongenerator/version-gen.go @@ -22,8 +22,6 @@ import ( "path/filepath" "strings" "text/template" - - "github.com/aws/amazon-ssm-agent/agent/appconfig" ) const versiongoTemplate = `// This is an autogenerated file and should not be edited. @@ -59,7 +57,7 @@ func main() { versionStr := strings.TrimSpace(string(versionContent)) fmt.Printf("Agent Version: %v", versionStr) - if err := ioutil.WriteFile(filepath.Join("VERSION"), []byte(versionStr), appconfig.ReadWriteAccess); err != nil { + if err := ioutil.WriteFile(filepath.Join("VERSION"), []byte(versionStr), 0600); err != nil { log.Fatalf("Error writing to VERSION file. %v", err) } @@ -108,7 +106,7 @@ func main() { releaseNoteOutFile := strings.Join(releaseNoteLines, "\n") - if err = ioutil.WriteFile(filepath.Join(releaseNotesFile), []byte(releaseNoteOutFile), appconfig.ReadWriteAccess); err != nil { + if err = ioutil.WriteFile(filepath.Join(releaseNotesFile), []byte(releaseNoteOutFile), 0600); err != nil { log.Fatalf("Error writing to RELEASENOTES.md file. %v", err) } -- 2.30.0