mirror of
https://github.com/bestnite/bilinovel-downloader.git
synced 2025-10-26 09:11:01 +00:00
feat: Add NFPM packaging and defer Playwright installation
This commit introduces NFPM configuration in `.goreleaser.yaml` to generate native packages for various Linux distributions (e.g., .deb, .rpm, .apk). This provides a more streamlined installation experience for Linux users. The Playwright browser installation logic has been moved from `main.go` to the `Run` function of the `download` command. This change ensures that Playwright binaries are only downloaded and installed when the `download` command is actually invoked, improving initial application startup performance and reducing unnecessary overhead for other commands. The Goreleaser configuration has also been updated to version 2 syntax and the `arm` architecture has been removed from builds.
This commit is contained in:
12
main.go
12
main.go
@@ -2,20 +2,8 @@ package main
|
||||
|
||||
import (
|
||||
"bilinovel-downloader/cmd"
|
||||
"io"
|
||||
"log"
|
||||
|
||||
"github.com/playwright-community/playwright-go"
|
||||
)
|
||||
|
||||
func main() {
|
||||
log.Println("Installing playwright")
|
||||
err := playwright.Install(&playwright.RunOptions{
|
||||
Browsers: []string{"chromium"},
|
||||
Stdout: io.Discard,
|
||||
})
|
||||
if err != nil {
|
||||
log.Panicf("failed to install playwright")
|
||||
}
|
||||
_ = cmd.RootCmd.Execute()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user