set cache location from cli args
This commit is contained in:
@@ -12,6 +12,7 @@ type Config struct {
|
||||
UserdataDir string
|
||||
DeiveID string
|
||||
Album string
|
||||
CacheFile string
|
||||
}
|
||||
|
||||
func Run(config Config) {
|
||||
@@ -29,7 +30,7 @@ func Run(config Config) {
|
||||
|
||||
immichClient := newImmichHttpClient(config.APIKey)
|
||||
|
||||
localState, err := loadLocalState("./state.json")
|
||||
localState, err := loadLocalState(config.CacheFile)
|
||||
if err != nil {
|
||||
log.Fatalf("Failed to load local state: %s", err)
|
||||
}
|
||||
@@ -81,7 +82,7 @@ func Run(config Config) {
|
||||
}
|
||||
|
||||
log.Println("Finished uploading screenshots")
|
||||
err = saveLocalState("./state.json", *localState)
|
||||
err = saveLocalState(config.CacheFile, *localState)
|
||||
if err != nil {
|
||||
log.Fatalf("Failed to save local cache: %s", err)
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user