Fixed error loops
This commit is contained in:
parent
44d20eb983
commit
f3a78f4bd6
3 changed files with 20 additions and 22 deletions
|
@ -78,7 +78,6 @@ func main() {
|
|||
spm.Run()
|
||||
}
|
||||
```
|
||||
*Functions, and specifically their names, are subject to change as I really don't like "AutoDownloadSpecified," but I don't want to make it "DownloadSpecified" yet, as there are still many functions in SPM used for manual downloads, installs, etc.*
|
||||
|
||||
<p align="center" style="font-size: 32px;">
|
||||
<strong>License</strong>
|
||||
|
|
33
auto.go
33
auto.go
|
@ -196,23 +196,22 @@ func DownloadSpecified(specs []AppIndexEntry) error {
|
|||
}
|
||||
fmt.Printf("[INFO] Found matching APPINDEX entry: %+v\n", *matchingEntry)
|
||||
|
||||
// // Check if an update is needed
|
||||
// updateNeeded, err := IsUpdateNeeded(
|
||||
// installDir,
|
||||
// matchingEntry.Name,
|
||||
// matchingEntry.Release,
|
||||
// matchingEntry.Version,
|
||||
// matchingEntry.Arch,
|
||||
// matchingEntry.OS,
|
||||
// )
|
||||
// if err != nil {
|
||||
// return fmt.Errorf("[ERROR] Failed to check if update is needed for %s: %w", matchingEntry.Name, err)
|
||||
// }
|
||||
updateNeeded, err := IsUpdateNeeded(
|
||||
installDir,
|
||||
matchingEntry.Name,
|
||||
matchingEntry.Release,
|
||||
matchingEntry.Version,
|
||||
matchingEntry.Arch,
|
||||
matchingEntry.OS,
|
||||
)
|
||||
if err != nil {
|
||||
return fmt.Errorf("[ERROR] Failed to check if update is needed for %s: %w", matchingEntry.Name, err)
|
||||
}
|
||||
|
||||
// if !updateNeeded {
|
||||
// fmt.Printf("[INFO] No update needed for package '%s'\n", matchingEntry.Name)
|
||||
// continue
|
||||
// }
|
||||
if !updateNeeded {
|
||||
fmt.Printf("[INFO] No update needed for package '%s'\n", matchingEntry.Name)
|
||||
continue
|
||||
}
|
||||
|
||||
// 5) Download the package
|
||||
downloadDir := GetTempDir()
|
||||
|
@ -243,7 +242,7 @@ func DownloadSpecified(specs []AppIndexEntry) error {
|
|||
}
|
||||
fmt.Printf("[INFO] Package '%s' decompressed successfully to: %s\n", matchingEntry.Name, tempDir)
|
||||
|
||||
// 7) Store in pendingUpdates for InstallUpdates
|
||||
// Add to pendingUpdates for InstallUpdates
|
||||
fmt.Printf("[INFO] Adding '%s' to pending updates\n", matchingEntry.Name)
|
||||
pendingUpdates = append(pendingUpdates, *matchingEntry)
|
||||
}
|
||||
|
|
|
@ -11,13 +11,13 @@ import (
|
|||
)
|
||||
|
||||
// RegisterApp is not supported on non-Windows platforms.
|
||||
func RegisterApp() error {
|
||||
return fmt.Errorf("RegisterApp is only available on Windows")
|
||||
func RegisterApp() {
|
||||
fmt.Println("[WARN] RegisterApp() is only available on Windows")
|
||||
}
|
||||
|
||||
// UnregisterApp is not supported on non-Windows platforms.
|
||||
func UnregisterApp() error {
|
||||
return fmt.Errorf("UnregisterApp is only available on Windows")
|
||||
func UnregisterApp() {
|
||||
fmt.Println("[WARN] UnregisterApp() is only available on Windows")
|
||||
}
|
||||
|
||||
// IsRegistered returns true if the application is detected as installed.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue