feat: initial commit
This commit is contained in:
12
pkg/wails3kit/updates/platform/linux/BUILD.bazel
Normal file
12
pkg/wails3kit/updates/platform/linux/BUILD.bazel
Normal file
@@ -0,0 +1,12 @@
|
||||
load("@io_bazel_rules_go//go:def.bzl", "go_library")
|
||||
|
||||
go_library(
|
||||
name = "linux",
|
||||
srcs = ["linux.go"],
|
||||
importpath = "github.com/Eriyc/rules_wails/pkg/wails3kit/updates/platform/linux",
|
||||
visibility = ["//visibility:public"],
|
||||
deps = [
|
||||
"//pkg/wails3kit/updates",
|
||||
"//pkg/wails3kit/updates/platform",
|
||||
],
|
||||
)
|
||||
20
pkg/wails3kit/updates/platform/linux/linux.go
Normal file
20
pkg/wails3kit/updates/platform/linux/linux.go
Normal file
@@ -0,0 +1,20 @@
|
||||
package linux
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"path/filepath"
|
||||
|
||||
"github.com/Eriyc/rules_wails/pkg/wails3kit/updates"
|
||||
"github.com/Eriyc/rules_wails/pkg/wails3kit/updates/platform"
|
||||
)
|
||||
|
||||
func New() updates.PlatformInstaller {
|
||||
return platform.New(DetectInstallRoot)
|
||||
}
|
||||
|
||||
func DetectInstallRoot(app updates.AppDescriptor) (updates.InstallRoot, error) {
|
||||
if app.ExecutablePath == "" {
|
||||
return updates.InstallRoot{}, errors.New("missing executable path")
|
||||
}
|
||||
return updates.InstallRoot{Path: filepath.Dir(app.ExecutablePath)}, nil
|
||||
}
|
||||
Reference in New Issue
Block a user