mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-02 15:11:53 +08:00

* [v2] Add support for post build hooks Currently only supports build-level hooks * [v2] Improve build assets handling and use single source for manifest generation The manifest asset files are now a go template and data will be resolved before they are included into the build output. Breaking Change: Windows manifest file must be named “wails.exe.manifest” and doesn’t depend on the project name anymore. * [v2, windows] NSIS installer generation
61 lines
1.3 KiB
Go
61 lines
1.3 KiB
Go
//go:build linux
|
|
// +build linux
|
|
|
|
package system
|
|
|
|
import (
|
|
"github.com/wailsapp/wails/v2/internal/system/operatingsystem"
|
|
"github.com/wailsapp/wails/v2/internal/system/packagemanager"
|
|
)
|
|
|
|
func (i *Info) discover() error {
|
|
|
|
var err error
|
|
osinfo, err := operatingsystem.Info()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
i.OS = osinfo
|
|
|
|
i.PM = packagemanager.Find(osinfo.ID)
|
|
if i.PM != nil {
|
|
dependencies, err := packagemanager.Dependancies(i.PM)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
for _, dep := range dependencies {
|
|
if dep.Name == "npm" {
|
|
locallyInstalled := checkNPM()
|
|
if locallyInstalled.Installed {
|
|
dep.Installed = true
|
|
dep.Version = locallyInstalled.Version
|
|
}
|
|
}
|
|
if dep.Name == "docker" {
|
|
locallyInstalled := checkDocker()
|
|
if locallyInstalled.Installed {
|
|
dep.Installed = true
|
|
dep.Version = locallyInstalled.Version
|
|
}
|
|
}
|
|
if dep.Name == "upx" {
|
|
locallyInstalled := checkUPX()
|
|
if locallyInstalled.Installed {
|
|
dep.Installed = true
|
|
dep.Version = locallyInstalled.Version
|
|
}
|
|
}
|
|
if dep.Name == "nsis" {
|
|
locallyInstalled := checkNSIS()
|
|
if locallyInstalled.Installed {
|
|
dep.Installed = true
|
|
dep.Version = locallyInstalled.Version
|
|
}
|
|
}
|
|
}
|
|
i.Dependencies = dependencies
|
|
}
|
|
|
|
return nil
|
|
}
|