forgejo-autoupdate

module
v0.0.0-...-17b9b49 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 3, 2025 License: GPL-3.0

README

Forgejo Auto-Update

Inspired by go-github-selfupdate, adapted for Forgejo instances.

Installation

go get https://codeberg.org/ChakSoft/forgejo-autoupdate

Usage

package main

import (
  "fmt"

  "codeberg.org/ChakSoft/forgejo-autoupdate"
)

func main() {
  updater := autoupdate.NewUpdater("v0.1.0", "codeberg.org", "myaccount", "myrepository", false)

  available, latest := updater.HasUpdateAvailable()
  if available {
    updatePath, currentExe, err := updater.DownloadUpdate()
    if err != nil {
      panic(err)
    }
    fmt.Printf("update binary is stored at: %s\n", updatePath)
  }
}

This example will download the update and stores it in the temporary folder of your system.

License

This software is distributed as-is, under GNU GPL v3 License.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL