Skip to content

Commit

Permalink
refactor: update error logging
Browse files Browse the repository at this point in the history
  • Loading branch information
depthbomb committed Apr 10, 2023
1 parent 4dd887c commit 9e4531c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func main() {

err := processFiles(images, outputDirectory)
if err != nil {
log.Fatalf("Error while processing images: %s", err)
log.Fatalf("Error while processing images: %v", err)
}

}
Expand All @@ -36,7 +36,7 @@ func onCompatibleWindowsVersion() bool {
func getImagesDirectory() string {
appdata, err := os.UserCacheDir()
if err != nil {
log.Fatalf("Unable to retrieve AppData path: %s", err)
log.Fatalf("Unable to retrieve AppData path: %v", err)
}

return filepath.Join(appdata, "Packages", "Microsoft.Windows.ContentDeliveryManager_cw5n1h2txyewy", "LocalState", "Assets")
Expand All @@ -45,15 +45,15 @@ func getImagesDirectory() string {
func getAndCreateOutputDirectory() string {
u, err := user.Current()
if err != nil {
log.Fatalf("Unable to get current user: %s", err)
log.Fatalf("Unable to get current user: %v", err)
}

outputPath := filepath.Join(u.HomeDir, "Pictures", "Windows Spotlight")

if !pathExists(outputPath) {
err = os.Mkdir(outputPath, 0666)
if err != nil {
log.Fatalf("Unable to create output directory: %s", err)
log.Fatalf("Unable to create output directory: %v", err)
}
}

Expand All @@ -74,7 +74,7 @@ func getImageFiles(path string) []string {
})

if err != nil {
log.Fatalf("Error while iterating image directory: %s", err)
log.Fatalf("Error while iterating image directory: %v", err)
}

return images
Expand Down Expand Up @@ -133,7 +133,7 @@ func pathExists(path string) bool {
if os.IsNotExist(err) {
return false
} else {
log.Fatalf("Error checking for path existence: %s", err)
log.Fatalf("Error checking for path existence: %v", err)

return false
}
Expand Down
2 changes: 1 addition & 1 deletion setup.iss
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#define MyAppName "SpotlightSaver"
#define MyAppDescription "Saves the pretty Windows 10 lockscreen wallpapers to your pictures folder"
#define MyAppVersion "4.0.0.0"
#define MyAppVersion "4.0.0.1"
#define MyAppPublisher "Caprine Logic"
#define MyAppExeName "spotlightsaver.exe"
#define MyAppCopyright "Copyright (C) 2022 Caprine Logic"
Expand Down

0 comments on commit 9e4531c

Please sign in to comment.