Skip to content

Commit

Permalink
Refactoring user overrides
Browse files Browse the repository at this point in the history
  • Loading branch information
boggydigital committed Dec 29, 2023
1 parent 131355d commit 2b52e4a
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.21

require (
github.com/arelate/southern_light v0.1.36
github.com/arelate/vangogh_local_data v0.4.9
github.com/arelate/vangogh_local_data v0.4.10
github.com/boggydigital/atomus v0.1.9
github.com/boggydigital/clo v1.0.4
github.com/boggydigital/coost v0.3.9
Expand All @@ -23,7 +23,7 @@ require (
require (
github.com/andybalholm/brotli v1.0.6 // indirect
github.com/boggydigital/match_node v0.1.16 // indirect
github.com/boggydigital/pathology v0.1.7 // indirect
github.com/boggydigital/pathology v0.1.8 // indirect
golang.org/x/image v0.14.0 // indirect
golang.org/x/net v0.19.0 // indirect
)
4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ github.com/arelate/vangogh_local_data v0.4.8 h1:UzMbHtx2p8Dv8SZGlWa6CJegLxdgedPR
github.com/arelate/vangogh_local_data v0.4.8/go.mod h1:g9RrWvMkhZLcYK0c9o4QY0bfm9gXNb2RqEWfeI8lVx4=
github.com/arelate/vangogh_local_data v0.4.9 h1:kucbkdnlV/SUBwmFZbzUpbxL5KokBxAWBCVQEbQfmNo=
github.com/arelate/vangogh_local_data v0.4.9/go.mod h1:zbNKzfGYXHSaqoZdFYdSADbXhf9+KVGbZ+qhSTukfoQ=
github.com/arelate/vangogh_local_data v0.4.10 h1:e8NJtdoxXcSOFwHLkGrQWW2tFRXnrmtlxGn6pY/SMPc=
github.com/arelate/vangogh_local_data v0.4.10/go.mod h1:vwSh3AMuItHqdej9plcyAvZS5lBAPw0hP+1UDzsJxHo=
github.com/boggydigital/atomus v0.1.9 h1:zAmXtAAXtBzMfz/83nEO4x8/uSLlPOq5wynW1jR/rbk=
github.com/boggydigital/atomus v0.1.9/go.mod h1:mvPDNDMrpFZ7RHbyMrt30hVXFU+VoeCvHnT83Zhj91I=
github.com/boggydigital/clo v1.0.4 h1:LKvXktyG+EeemzjnSp0DYIAEbY2/rvFcuHtjjwJk280=
Expand Down Expand Up @@ -64,6 +66,8 @@ github.com/boggydigital/pathology v0.1.6 h1:ssWIR8Z78x/546IkXInnsGcUutA76R+cEK4E
github.com/boggydigital/pathology v0.1.6/go.mod h1:IqegmSGqlK1UR9+P6Mrua7+ZYdB8NC07sIs4Z+u2BMk=
github.com/boggydigital/pathology v0.1.7 h1:mo6IQ3e4eLmP7xL437mIiZn1uqC0JdXIZm8OI9FPnX8=
github.com/boggydigital/pathology v0.1.7/go.mod h1:IqegmSGqlK1UR9+P6Mrua7+ZYdB8NC07sIs4Z+u2BMk=
github.com/boggydigital/pathology v0.1.8 h1:a5brNIQS//yednzdJsxtCExHVJLlu8hhi2pB1D/us0U=
github.com/boggydigital/pathology v0.1.8/go.mod h1:kv9hzFMn1Ud0Hxn2vITcZAS68YuB/XbaErXXcANcolU=
github.com/boggydigital/testo v0.1.8 h1:NKuKLpWKn8gG3dYq8xNrFYHimxoCTdzLOs242q6jeQo=
github.com/boggydigital/testo v0.1.8/go.mod h1:8JTO6UKeQPsHS82vbCH/3NLDfewmr/84vVQ6rNLdCas=
github.com/boggydigital/wits v0.2.3 h1:Z0eB+QlIA18fJmblyV6ZJQ/swPYSFhOxfgMXOQz4/c8=
Expand Down
13 changes: 11 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"github.com/boggydigital/clo"
"github.com/boggydigital/nod"
"github.com/boggydigital/pathology"
"github.com/boggydigital/wits"
_ "image/jpeg"
"os"
)
Expand All @@ -35,8 +36,16 @@ func main() {
if err := pathology.SetAbsDirs(vangogh_local_data.AllAbsDirs...); err != nil {
panic(err)
}
if err := pathology.SetUserDirsOverrides(userDirsFilename); err != nil {
panic(err)
if _, err := os.Stat(userDirsFilename); err == nil {
udFile, err := os.Open(userDirsFilename)
if err != nil {
panic(err)
}
userDirs, err := wits.ReadKeyValue(udFile)
if err != nil {
panic(err)
}
pathology.SetUserDirsOverrides(userDirs)
}
pathology.SetRelToAbsDir(vangogh_local_data.RelToAbsDirs)

Expand Down

0 comments on commit 2b52e4a

Please sign in to comment.