Skip to content

Commit

Permalink
fix: cache /etc/os-release
Browse files Browse the repository at this point in the history
  • Loading branch information
Devin Pastoor committed Feb 14, 2021
1 parent ab59c16 commit be59972
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cran/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ func ReadOsRelease() error {
if err != nil {
return err
}
log.WithField("config", string(configData)).Trace("got config data from /etc/os-release")
//Find all unquoted strings and quote them
re := regexp.MustCompile(`(.*?=)([^"].*)`)
fixedConfig := re.ReplaceAll(configData, []byte("${1}\"${2}\""))
Expand All @@ -202,6 +203,6 @@ func ReadOsRelease() error {

ltsRelease := ltsReleaseMatcher.ReplaceAllString(osRelease.Version, "$1")
osRelease.LtsRelease = ltsRelease
osRelease.checked = false
osRelease.checked = true
return nil
}

0 comments on commit be59972

Please sign in to comment.