mirror of
https://github.com/taigrr/wails.git
synced 2026-04-04 06:02:43 -07:00
Compare commits
1 Commits
2---Suppor
...
gitbash-fi
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9164bf17c0 |
19
.github/stale.yml
vendored
19
.github/stale.yml
vendored
@@ -1,19 +0,0 @@
|
|||||||
# Number of days of inactivity before an issue becomes stale
|
|
||||||
daysUntilStale: 30
|
|
||||||
# Number of days of inactivity before a stale issue is closed
|
|
||||||
daysUntilClose: 7
|
|
||||||
# Issues with these labels will never be considered stale
|
|
||||||
exemptLabels:
|
|
||||||
- pinned
|
|
||||||
- security
|
|
||||||
- onhold
|
|
||||||
- inprogress
|
|
||||||
# Label to use when marking an issue as stale
|
|
||||||
staleLabel: wontfix
|
|
||||||
# Comment to post when marking an issue as stale. Set to `false` to disable
|
|
||||||
markComment: >
|
|
||||||
This issue has been automatically marked as stale because it has not had
|
|
||||||
recent activity. It will be closed if no further activity occurs. Thank you
|
|
||||||
for your contributions.
|
|
||||||
# Comment to post when closing a stale issue. Set to `false` to disable
|
|
||||||
closeComment: false
|
|
||||||
7
.vscode/launch.json
vendored
7
.vscode/launch.json
vendored
@@ -4,13 +4,6 @@
|
|||||||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
||||||
"version": "0.2.0",
|
"version": "0.2.0",
|
||||||
"configurations": [
|
"configurations": [
|
||||||
{
|
|
||||||
"name": "Test cmd package",
|
|
||||||
"type": "go",
|
|
||||||
"request": "launch",
|
|
||||||
"mode": "test",
|
|
||||||
"program": "${workspaceFolder}/cmd/"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"name": "Wails Init",
|
"name": "Wails Init",
|
||||||
"type": "go",
|
"type": "go",
|
||||||
|
|||||||
@@ -16,4 +16,3 @@ Wails is what it is because of the time and effort given by these great people.
|
|||||||
* [fallendusk](https://github.com/fallendusk)
|
* [fallendusk](https://github.com/fallendusk)
|
||||||
* [Florian Didran](https://github.com/fdidron)
|
* [Florian Didran](https://github.com/fdidron)
|
||||||
* [Nikolai Zimmermann](https://github.com/Chronophylos)
|
* [Nikolai Zimmermann](https://github.com/Chronophylos)
|
||||||
* [Toyam Cox](https://github.com/Vaelatern)
|
|
||||||
|
|||||||
27
README.md
27
README.md
@@ -46,40 +46,21 @@ Make sure you have the xcode command line tools installed. This can be done by r
|
|||||||
|
|
||||||
### Linux
|
### Linux
|
||||||
|
|
||||||
#### Debian/Ubuntu
|
#### Ubuntu 18.04, Debian 9, Zorin 15
|
||||||
|
|
||||||
`sudo apt install libgtk-3-dev libwebkit2gtk-4.0-dev`
|
`sudo apt install libgtk-3-dev libwebkit2gtk-4.0-dev`
|
||||||
|
|
||||||
_Debian: 8, 9, 10_
|
|
||||||
_Ubuntu: 16.04, 18.04, 19.04_
|
|
||||||
|
|
||||||
_Also succesfully tested on: Zorin 15, Parrot 4.7, Linuxmint 19, Elementary 5, Kali-Rolling_
|
|
||||||
|
|
||||||
#### Arch Linux
|
#### Arch Linux
|
||||||
|
|
||||||
`sudo pacman -S webkit2gtk gtk3`
|
`sudo pacman -S webkit2gtk gtk3`
|
||||||
|
|
||||||
_Also succesfully test on: ArcoLinuxB_
|
#### Fedora 30
|
||||||
|
|
||||||
#### Centos
|
|
||||||
|
|
||||||
`sudo yum install webkitgtk3-devel gtk3-devel`
|
|
||||||
|
|
||||||
_CentOS 6, 7_
|
|
||||||
|
|
||||||
#### Fedora
|
|
||||||
|
|
||||||
`sudo yum install webkit2gtk3-devel gtk3-devel`
|
`sudo yum install webkit2gtk3-devel gtk3-devel`
|
||||||
|
|
||||||
_Fedora 29, 30_
|
#### Centos 7
|
||||||
|
|
||||||
#### VoidLinux & VoidLinux-musl
|
`sudo yum install webkitgtk3-devel gtk3-devel`
|
||||||
|
|
||||||
`xbps-install gtk+3-devel webkit2gtk-devel`
|
|
||||||
|
|
||||||
#### Gentoo
|
|
||||||
|
|
||||||
`sudo emerge gtk+:3 webkit-gtk`
|
|
||||||
|
|
||||||
### Windows
|
### Windows
|
||||||
|
|
||||||
|
|||||||
@@ -1,138 +0,0 @@
|
|||||||
# avoid double trigger by applying some rules
|
|
||||||
# start a pipeline when push to 'master' branch
|
|
||||||
trigger:
|
|
||||||
- master
|
|
||||||
# or when pull request on 'develop' branch
|
|
||||||
pr:
|
|
||||||
- develop
|
|
||||||
|
|
||||||
# for now there is only one stage 'Build'
|
|
||||||
# in the future we could use multistage strategy for releases
|
|
||||||
stages:
|
|
||||||
- stage: Build
|
|
||||||
|
|
||||||
# there are 3 jobs
|
|
||||||
# one for each os
|
|
||||||
jobs:
|
|
||||||
- deployment: Linux
|
|
||||||
displayName: Lin
|
|
||||||
variables:
|
|
||||||
GOPATH: '$(Agent.BuildDirectory)/gopath' # Go workspace path
|
|
||||||
GOROOT: '$(Agent.BuildDirectory)/go' # Go installation path
|
|
||||||
GOBIN: '$(GOPATH)/bin' # Go binaries path
|
|
||||||
GOMODULE: 'on'
|
|
||||||
modulePath: '$(Agent.BuildDirectory)/wails' # Path to the module's code
|
|
||||||
pool:
|
|
||||||
vmImage: 'Ubuntu-16.04'
|
|
||||||
environment: 'linux-dev'
|
|
||||||
strategy:
|
|
||||||
runOnce:
|
|
||||||
deploy:
|
|
||||||
steps:
|
|
||||||
- checkout: self # self represents the repo where the initial Pipelines YAML file was found
|
|
||||||
clean: true # whether to fetch clean each time
|
|
||||||
path: wails # path to check out source code, relative to the agent's build directory (e.g. \_work\1)
|
|
||||||
# go version 1.12.7
|
|
||||||
- script: |
|
|
||||||
wget "https://storage.googleapis.com/golang/go1.12.7.linux-amd64.tar.gz" --output-document "$(Agent.BuildDirectory)/go1.12.7.tar.gz"
|
|
||||||
tar -C '$(Agent.BuildDirectory)' -xzf "$(Agent.BuildDirectory)/go1.12.7.tar.gz"
|
|
||||||
displayName: 'Install Go 1.12.7 Linux'
|
|
||||||
- script: |
|
|
||||||
mkdir -p '$(GOBIN)'
|
|
||||||
mkdir -p '$(GOPATH)/pkg'
|
|
||||||
mkdir -p '$(GOROOT)'
|
|
||||||
shopt -s extglob
|
|
||||||
shopt -s dotglob
|
|
||||||
echo '##vso[task.prependpath]$(GOBIN)'
|
|
||||||
echo '##vso[task.prependpath]$(GOROOT)/bin'
|
|
||||||
displayName: 'Set up the Go workspace'
|
|
||||||
- script: |
|
|
||||||
go version
|
|
||||||
go get -v -d ./...
|
|
||||||
cd cmd/wails
|
|
||||||
go install
|
|
||||||
workingDirectory: '$(modulePath)'
|
|
||||||
displayName: 'Get dependencies, then build'
|
|
||||||
- script: |
|
|
||||||
wails version
|
|
||||||
workingDirectory: '$(modulePath)'
|
|
||||||
displayName: 'Check we have output'
|
|
||||||
|
|
||||||
- deployment: Mac
|
|
||||||
displayName: Mac
|
|
||||||
variables:
|
|
||||||
GOPATH: '$(Agent.BuildDirectory)/gopath' # Go workspace path
|
|
||||||
GOROOT: '$(Agent.BuildDirectory)/go' # Go installation path
|
|
||||||
GOBIN: '$(GOPATH)/bin' # Go binaries path
|
|
||||||
GOMODULE: 'on'
|
|
||||||
modulePath: '$(Agent.BuildDirectory)/wails' # Path to the module's code
|
|
||||||
pool:
|
|
||||||
vmImage: 'macOS-10.14'
|
|
||||||
environment: 'mac-dev'
|
|
||||||
strategy:
|
|
||||||
runOnce:
|
|
||||||
deploy:
|
|
||||||
steps:
|
|
||||||
- checkout: self # self represents the repo where the initial Pipelines YAML file was found
|
|
||||||
clean: true # whether to fetch clean each time
|
|
||||||
path: wails # path to check out source code, relative to the agent's build directory (e.g. \_work\1)
|
|
||||||
# go version 1.12.7
|
|
||||||
- script: |
|
|
||||||
wget "https://storage.googleapis.com/golang/go1.12.7.darwin-amd64.tar.gz" --output-document "$(Agent.BuildDirectory)/go1.12.7.tar.gz"
|
|
||||||
tar -C '$(Agent.BuildDirectory)' -xzf "$(Agent.BuildDirectory)/go1.12.7.tar.gz"
|
|
||||||
displayName: 'Install Go 1.12.7 Linux'
|
|
||||||
- script: |
|
|
||||||
mkdir -p '$(GOBIN)'
|
|
||||||
mkdir -p '$(GOPATH)/pkg'
|
|
||||||
mkdir -p '$(GOROOT)'
|
|
||||||
shopt -s extglob
|
|
||||||
shopt -s dotglob
|
|
||||||
echo '##vso[task.prependpath]$(GOBIN)'
|
|
||||||
echo '##vso[task.prependpath]$(GOROOT)/bin'
|
|
||||||
displayName: 'Set up the Go workspace'
|
|
||||||
- script: |
|
|
||||||
go version
|
|
||||||
go get -v -d ./...
|
|
||||||
cd cmd/wails
|
|
||||||
go install
|
|
||||||
workingDirectory: '$(modulePath)'
|
|
||||||
displayName: 'Get dependencies, then build'
|
|
||||||
- script: |
|
|
||||||
wails version
|
|
||||||
workingDirectory: '$(modulePath)'
|
|
||||||
displayName: 'Check we have output'
|
|
||||||
|
|
||||||
- deployment: Win
|
|
||||||
displayName: Win
|
|
||||||
variables:
|
|
||||||
GOMODULE: 'on'
|
|
||||||
modulePath: '$(Agent.BuildDirectory)/wails' # Path to the module's code
|
|
||||||
pool:
|
|
||||||
vmImage: 'windows-2019'
|
|
||||||
environment: 'win-dev'
|
|
||||||
strategy:
|
|
||||||
runOnce:
|
|
||||||
deploy:
|
|
||||||
steps:
|
|
||||||
- checkout: self # self represents the repo where the initial Pipelines YAML file was found
|
|
||||||
clean: true # whether to fetch clean each time
|
|
||||||
path: wails # path to check out source code, relative to the agent's build directory (e.g. \_work\1)
|
|
||||||
# Go tool installer
|
|
||||||
# Find in cache or download a specific version of Go and add it to the PATH
|
|
||||||
- task: GoTool@0
|
|
||||||
inputs:
|
|
||||||
version: '1.12.7'
|
|
||||||
goPath: '$(Agent.BuildDirectory)/go'
|
|
||||||
goBin: '$(Agent.BuildDirectory)/go/bin'
|
|
||||||
displayName: 'Set up the Go workspace'
|
|
||||||
- script: |
|
|
||||||
go version
|
|
||||||
go get -v -d ./...
|
|
||||||
cd cmd/wails
|
|
||||||
go install
|
|
||||||
workingDirectory: '$(modulePath)'
|
|
||||||
displayName: 'Get dependencies, then build'
|
|
||||||
- script: |
|
|
||||||
wails version
|
|
||||||
workingDirectory: '$(Agent.BuildDirectory)/go/bin'
|
|
||||||
displayName: 'Check we have output'
|
|
||||||
File diff suppressed because one or more lines are too long
@@ -18,7 +18,7 @@ func NewGitHubHelper() *GitHubHelper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// GetVersionTags gets the list of tags on the Wails repo
|
// GetVersionTags gets the list of tags on the Wails repo
|
||||||
// It returns a list of sorted tags in descending order
|
// It retuns a list of sorted tags in descending order
|
||||||
func (g *GitHubHelper) GetVersionTags() ([]*SemanticVersion, error) {
|
func (g *GitHubHelper) GetVersionTags() ([]*SemanticVersion, error) {
|
||||||
|
|
||||||
result := []*SemanticVersion{}
|
result := []*SemanticVersion{}
|
||||||
|
|||||||
153
cmd/linux.go
153
cmd/linux.go
@@ -17,30 +17,22 @@ type LinuxDistribution int
|
|||||||
const (
|
const (
|
||||||
// Unknown is the catch-all distro
|
// Unknown is the catch-all distro
|
||||||
Unknown LinuxDistribution = iota
|
Unknown LinuxDistribution = iota
|
||||||
// Debian distribution
|
|
||||||
Debian
|
|
||||||
// Ubuntu distribution
|
// Ubuntu distribution
|
||||||
Ubuntu
|
Ubuntu
|
||||||
// Arch linux distribution
|
// Arch linux distribution
|
||||||
Arch
|
Arch
|
||||||
|
// RedHat linux distribution
|
||||||
|
RedHat
|
||||||
// CentOS linux distribution
|
// CentOS linux distribution
|
||||||
CentOS
|
CentOS
|
||||||
// Fedora linux distribution
|
// Fedora linux distribution
|
||||||
Fedora
|
Fedora
|
||||||
|
// Debian distribution
|
||||||
|
Debian
|
||||||
// Gentoo distribution
|
// Gentoo distribution
|
||||||
Gentoo
|
Gentoo
|
||||||
// Zorin distribution
|
// Zorin distribution
|
||||||
Zorin
|
Zorin
|
||||||
// Parrot distribution
|
|
||||||
Parrot
|
|
||||||
// Linuxmint distribution
|
|
||||||
Linuxmint
|
|
||||||
// VoidLinux distribution
|
|
||||||
VoidLinux
|
|
||||||
// Elementary distribution
|
|
||||||
Elementary
|
|
||||||
// Kali distribution
|
|
||||||
Kali
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// DistroInfo contains all the information relating to a linux distribution
|
// DistroInfo contains all the information relating to a linux distribution
|
||||||
@@ -50,90 +42,69 @@ type DistroInfo struct {
|
|||||||
ID string
|
ID string
|
||||||
Description string
|
Description string
|
||||||
Release string
|
Release string
|
||||||
|
DiscoveredBy string
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetLinuxDistroInfo returns information about the running linux distribution
|
// GetLinuxDistroInfo returns information about the running linux distribution
|
||||||
func GetLinuxDistroInfo() *DistroInfo {
|
func GetLinuxDistroInfo() *DistroInfo {
|
||||||
result := &DistroInfo{
|
|
||||||
Distribution: Unknown,
|
|
||||||
ID: "unknown",
|
|
||||||
Name: "Unknown",
|
|
||||||
}
|
|
||||||
_, err := os.Stat("/etc/os-release")
|
|
||||||
if !os.IsNotExist(err) {
|
|
||||||
osRelease, _ := ioutil.ReadFile("/etc/os-release")
|
|
||||||
result = parseOsRelease(string(osRelease))
|
|
||||||
}
|
|
||||||
return result
|
|
||||||
}
|
|
||||||
|
|
||||||
// parseOsRelease parses the given os-release data and returns
|
|
||||||
// a DistroInfo struct with the details
|
|
||||||
func parseOsRelease(osRelease string) *DistroInfo {
|
|
||||||
result := &DistroInfo{Distribution: Unknown}
|
result := &DistroInfo{Distribution: Unknown}
|
||||||
|
|
||||||
// Default value
|
_, err := os.Stat("/etc/os-release")
|
||||||
osID := "unknown"
|
if !os.IsNotExist(err) {
|
||||||
osNAME := "Unknown"
|
// Default value
|
||||||
version := ""
|
osID := "unknown"
|
||||||
|
osNAME := "Unknown"
|
||||||
|
version := ""
|
||||||
|
// read /etc/os-release
|
||||||
|
osRelease, _ := ioutil.ReadFile("/etc/os-release")
|
||||||
|
// Split into lines
|
||||||
|
lines := strings.Split(string(osRelease), "\n")
|
||||||
|
// Iterate lines
|
||||||
|
for _, line := range lines {
|
||||||
|
// Split each line by the equals char
|
||||||
|
splitLine := strings.SplitN(line, "=", 2)
|
||||||
|
// Check we have
|
||||||
|
if len(splitLine) != 2 {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
switch splitLine[0] {
|
||||||
|
case "ID":
|
||||||
|
osID = strings.Trim(splitLine[1], "\"")
|
||||||
|
case "NAME":
|
||||||
|
osNAME = strings.Trim(splitLine[1], "\"")
|
||||||
|
case "VERSION_ID":
|
||||||
|
version = strings.Trim(splitLine[1], "\"")
|
||||||
|
}
|
||||||
|
|
||||||
// Split into lines
|
|
||||||
lines := strings.Split(osRelease, "\n")
|
|
||||||
// Iterate lines
|
|
||||||
for _, line := range lines {
|
|
||||||
// Split each line by the equals char
|
|
||||||
splitLine := strings.SplitN(line, "=", 2)
|
|
||||||
// Check we have
|
|
||||||
if len(splitLine) != 2 {
|
|
||||||
continue
|
|
||||||
}
|
}
|
||||||
switch splitLine[0] {
|
// Check distro name against list of distros
|
||||||
case "ID":
|
result.Release = version
|
||||||
osID = strings.Trim(splitLine[1], "\"")
|
result.DiscoveredBy = "/etc/os-release"
|
||||||
case "NAME":
|
switch osID {
|
||||||
osNAME = strings.Trim(splitLine[1], "\"")
|
case "fedora":
|
||||||
case "VERSION_ID":
|
result.Distribution = Fedora
|
||||||
version = strings.Trim(splitLine[1], "\"")
|
case "centos":
|
||||||
|
result.Distribution = CentOS
|
||||||
|
case "arch":
|
||||||
|
result.Distribution = Arch
|
||||||
|
case "debian":
|
||||||
|
result.Distribution = Debian
|
||||||
|
case "ubuntu":
|
||||||
|
result.Distribution = Ubuntu
|
||||||
|
case "gentoo":
|
||||||
|
result.Distribution = Gentoo
|
||||||
|
case "zorin":
|
||||||
|
result.Distribution = Zorin
|
||||||
|
default:
|
||||||
|
result.Distribution = Unknown
|
||||||
}
|
}
|
||||||
}
|
|
||||||
// Check distro name against list of distros
|
|
||||||
switch osID {
|
|
||||||
case "fedora":
|
|
||||||
result.Distribution = Fedora
|
|
||||||
case "centos":
|
|
||||||
result.Distribution = CentOS
|
|
||||||
case "arch":
|
|
||||||
result.Distribution = Arch
|
|
||||||
case "debian":
|
|
||||||
result.Distribution = Debian
|
|
||||||
case "ubuntu":
|
|
||||||
result.Distribution = Ubuntu
|
|
||||||
case "gentoo":
|
|
||||||
result.Distribution = Gentoo
|
|
||||||
case "zorin":
|
|
||||||
result.Distribution = Zorin
|
|
||||||
case "parrot":
|
|
||||||
result.Distribution = Parrot
|
|
||||||
case "linuxmint":
|
|
||||||
result.Distribution = Linuxmint
|
|
||||||
case "void":
|
|
||||||
result.Distribution = VoidLinux
|
|
||||||
case "elementary":
|
|
||||||
result.Distribution = Elementary
|
|
||||||
default:
|
|
||||||
result.Distribution = Unknown
|
|
||||||
}
|
|
||||||
|
|
||||||
result.Name = osNAME
|
|
||||||
result.ID = osID
|
|
||||||
result.Release = version
|
|
||||||
|
|
||||||
|
result.ID = osID
|
||||||
|
result.Name = osNAME
|
||||||
|
}
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
// CheckPkgInstalled is all functions that use local programs to see if a package is installed
|
|
||||||
type CheckPkgInstalled func(string) (bool, error)
|
|
||||||
|
|
||||||
// EqueryInstalled uses equery to see if a package is installed
|
// EqueryInstalled uses equery to see if a package is installed
|
||||||
func EqueryInstalled(packageName string) (bool, error) {
|
func EqueryInstalled(packageName string) (bool, error) {
|
||||||
program := NewProgramHelper()
|
program := NewProgramHelper()
|
||||||
@@ -167,17 +138,6 @@ func PacmanInstalled(packageName string) (bool, error) {
|
|||||||
return exitCode == 0, nil
|
return exitCode == 0, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// XbpsInstalled uses pacman to see if a package is installed.
|
|
||||||
func XbpsInstalled(packageName string) (bool, error) {
|
|
||||||
program := NewProgramHelper()
|
|
||||||
xbpsQuery := program.FindProgram("xbps-query")
|
|
||||||
if xbpsQuery == nil {
|
|
||||||
return false, fmt.Errorf("cannot check dependencies: xbps-query not found")
|
|
||||||
}
|
|
||||||
_, _, exitCode, _ := xbpsQuery.Run("-S", packageName)
|
|
||||||
return exitCode == 0, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// RpmInstalled uses rpm to see if a package is installed
|
// RpmInstalled uses rpm to see if a package is installed
|
||||||
func RpmInstalled(packageName string) (bool, error) {
|
func RpmInstalled(packageName string) (bool, error) {
|
||||||
program := NewProgramHelper()
|
program := NewProgramHelper()
|
||||||
@@ -191,9 +151,9 @@ func RpmInstalled(packageName string) (bool, error) {
|
|||||||
|
|
||||||
// RequestSupportForDistribution promts the user to submit a request to support their
|
// RequestSupportForDistribution promts the user to submit a request to support their
|
||||||
// currently unsupported distribution
|
// currently unsupported distribution
|
||||||
func RequestSupportForDistribution(distroInfo *DistroInfo) error {
|
func RequestSupportForDistribution(distroInfo *DistroInfo, libraryName string) error {
|
||||||
var logger = NewLogger()
|
var logger = NewLogger()
|
||||||
defaultError := fmt.Errorf("unable to check libraries on distribution '%s'", distroInfo.Name)
|
defaultError := fmt.Errorf("unable to check libraries on distribution '%s'. Please ensure that the '%s' equivalent is installed", distroInfo.Name, libraryName)
|
||||||
|
|
||||||
logger.Yellow("Distribution '%s' is not currently supported, but we would love to!", distroInfo.Name)
|
logger.Yellow("Distribution '%s' is not currently supported, but we would love to!", distroInfo.Name)
|
||||||
q := fmt.Sprintf("Would you like to submit a request to support distribution '%s'?", distroInfo.Name)
|
q := fmt.Sprintf("Would you like to submit a request to support distribution '%s'?", distroInfo.Name)
|
||||||
@@ -220,6 +180,7 @@ func RequestSupportForDistribution(distroInfo *DistroInfo) error {
|
|||||||
str.WriteString(fmt.Sprintf("| Distribution ID | %s |\n", distroInfo.ID))
|
str.WriteString(fmt.Sprintf("| Distribution ID | %s |\n", distroInfo.ID))
|
||||||
str.WriteString(fmt.Sprintf("| Distribution Name | %s |\n", distroInfo.Name))
|
str.WriteString(fmt.Sprintf("| Distribution Name | %s |\n", distroInfo.Name))
|
||||||
str.WriteString(fmt.Sprintf("| Distribution Version | %s |\n", distroInfo.Release))
|
str.WriteString(fmt.Sprintf("| Distribution Version | %s |\n", distroInfo.Release))
|
||||||
|
str.WriteString(fmt.Sprintf("| Discovered by | %s |\n", distroInfo.DiscoveredBy))
|
||||||
|
|
||||||
body := fmt.Sprintf("**Description**\nDistribution '%s' is currently unsupported.\n\n**Further Information**\n\n%s\n\n*Please add any extra information here, EG: libraries that are needed to make the distribution work, or commands to install them*", distroInfo.ID, str.String())
|
body := fmt.Sprintf("**Description**\nDistribution '%s' is currently unsupported.\n\n**Further Information**\n\n%s\n\n*Please add any extra information here, EG: libraries that are needed to make the distribution work, or commands to install them*", distroInfo.ID, str.String())
|
||||||
fullURL := "https://github.com/wailsapp/wails/issues/new?"
|
fullURL := "https://github.com/wailsapp/wails/issues/new?"
|
||||||
|
|||||||
@@ -1,26 +0,0 @@
|
|||||||
package cmd
|
|
||||||
|
|
||||||
import "testing"
|
|
||||||
|
|
||||||
func TestUbuntuDetection(t *testing.T) {
|
|
||||||
osrelease := `
|
|
||||||
NAME="Ubuntu"
|
|
||||||
VERSION="18.04.2 LTS (Bionic Beaver)"
|
|
||||||
ID=ubuntu
|
|
||||||
ID_LIKE=debian
|
|
||||||
PRETTY_NAME="Ubuntu 18.04.2 LTS"
|
|
||||||
VERSION_ID="18.04"
|
|
||||||
HOME_URL="https://www.ubuntu.com/"
|
|
||||||
SUPPORT_URL="https://help.ubuntu.com/"
|
|
||||||
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
|
|
||||||
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
|
|
||||||
VERSION_CODENAME=bionic
|
|
||||||
UBUNTU_CODENAME=bionic
|
|
||||||
`
|
|
||||||
|
|
||||||
result := parseOsRelease(osrelease)
|
|
||||||
if result.Distribution != Ubuntu {
|
|
||||||
t.Errorf("expected 'Ubuntu' ID but got '%d'", result.Distribution)
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,91 +0,0 @@
|
|||||||
package cmd
|
|
||||||
|
|
||||||
import (
|
|
||||||
"log"
|
|
||||||
|
|
||||||
"github.com/leaanthony/mewn"
|
|
||||||
"gopkg.in/yaml.v3"
|
|
||||||
)
|
|
||||||
|
|
||||||
// LinuxDB is the database for linux distribution data.
|
|
||||||
type LinuxDB struct {
|
|
||||||
Distributions map[string]*Distribution `yaml:"distributions"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// Distribution holds the os-release ID and a map of releases.
|
|
||||||
type Distribution struct {
|
|
||||||
ID string `yaml:"id"`
|
|
||||||
Releases map[string]*Release `yaml:"releases"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetRelease attempts to return the specific Release information
|
|
||||||
// for the given release name. If there is no specific match, the
|
|
||||||
// default release data is returned.
|
|
||||||
func (d *Distribution) GetRelease(version string) *Release {
|
|
||||||
result := d.Releases[version]
|
|
||||||
if result == nil {
|
|
||||||
result = d.Releases["default"]
|
|
||||||
}
|
|
||||||
return result
|
|
||||||
}
|
|
||||||
|
|
||||||
// Release holds the name and version of the release as given by
|
|
||||||
// os-release. Programs is a slice of dependant programs required
|
|
||||||
// to be present on the local installation for Wails to function.
|
|
||||||
// Libraries is a slice of libraries that must be present for Wails
|
|
||||||
// applications to compile.
|
|
||||||
type Release struct {
|
|
||||||
Name string `yaml:"name"`
|
|
||||||
Version string `yaml:"version"`
|
|
||||||
GccVersionCommand string `yaml:"gccversioncommand"`
|
|
||||||
Programs []*Prerequisite `yaml:"programs"`
|
|
||||||
Libraries []*Prerequisite `yaml:"libraries"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// Prerequisite is a simple struct containing a program/library name
|
|
||||||
// plus the distribution specific help text indicating how to install
|
|
||||||
// it.
|
|
||||||
type Prerequisite struct {
|
|
||||||
Name string `yaml:"name"`
|
|
||||||
Help string `yaml:"help,omitempty"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// Load will load the given filename from disk and attempt to
|
|
||||||
// import the data into the LinuxDB.
|
|
||||||
func (l *LinuxDB) Load(filename string) error {
|
|
||||||
if fs.FileExists(filename) {
|
|
||||||
data, err := fs.LoadAsBytes(filename)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
return l.ImportData(data)
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// ImportData will unmarshal the given YAML formatted data
|
|
||||||
// into the LinuxDB
|
|
||||||
func (l *LinuxDB) ImportData(data []byte) error {
|
|
||||||
return yaml.Unmarshal(data, l)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetDistro returns the Distribution information for the
|
|
||||||
// given distribution name. If the distribution is not supported,
|
|
||||||
// nil is returned.
|
|
||||||
func (l *LinuxDB) GetDistro(distro string) *Distribution {
|
|
||||||
return l.Distributions[distro]
|
|
||||||
}
|
|
||||||
|
|
||||||
// NewLinuxDB creates a new LinuxDB instance from the bundled
|
|
||||||
// linuxdb.yaml file.
|
|
||||||
func NewLinuxDB() *LinuxDB {
|
|
||||||
data := mewn.Bytes("./linuxdb.yaml")
|
|
||||||
result := LinuxDB{
|
|
||||||
Distributions: make(map[string]*Distribution),
|
|
||||||
}
|
|
||||||
err := result.ImportData(data)
|
|
||||||
if err != nil {
|
|
||||||
log.Fatal(err)
|
|
||||||
}
|
|
||||||
return &result
|
|
||||||
}
|
|
||||||
170
cmd/linuxdb.yaml
170
cmd/linuxdb.yaml
@@ -1,170 +0,0 @@
|
|||||||
---
|
|
||||||
distributions:
|
|
||||||
debian:
|
|
||||||
id: debian
|
|
||||||
releases:
|
|
||||||
default:
|
|
||||||
name: Debian
|
|
||||||
version: default
|
|
||||||
gccversioncommand: &gccdumpversion -dumpversion
|
|
||||||
programs: &debiandefaultprograms
|
|
||||||
- name: gcc
|
|
||||||
help: Please install with `sudo apt-get install build-essential` and try again
|
|
||||||
- name: pkg-config
|
|
||||||
help: Please install with `sudo apt-get install pkg-config` and try again
|
|
||||||
- name: npm
|
|
||||||
help: Please install with `curl -sL https://deb.nodesource.com/setup_12.x | sudo bash - && sudo apt-get install -y nodejs` and try again
|
|
||||||
libraries: &debiandefaultlibraries
|
|
||||||
- name: libgtk-3-dev
|
|
||||||
help: Please install with `sudo apt-get install libgtk-3-dev` and try again
|
|
||||||
- name: libwebkit2gtk-4.0-dev
|
|
||||||
help: Please install with `sudo apt-get install libwebkit2gtk-4.0-dev` and try again
|
|
||||||
ubuntu:
|
|
||||||
id: ubuntu
|
|
||||||
releases:
|
|
||||||
default:
|
|
||||||
version: default
|
|
||||||
name: Ubuntu
|
|
||||||
gccversioncommand: &gccdumpfullversion -dumpfullversion
|
|
||||||
programs: *debiandefaultprograms
|
|
||||||
libraries: *debiandefaultlibraries
|
|
||||||
kali:
|
|
||||||
id: kali
|
|
||||||
releases:
|
|
||||||
default:
|
|
||||||
version: default
|
|
||||||
name: Kali GNU/Linux
|
|
||||||
gccversioncommand: *gccdumpfullversion
|
|
||||||
programs: *debiandefaultprograms
|
|
||||||
libraries: *debiandefaultlibraries
|
|
||||||
parrot:
|
|
||||||
id: parrot
|
|
||||||
releases:
|
|
||||||
default:
|
|
||||||
version: default
|
|
||||||
name: Parrot GNU/Linux
|
|
||||||
gccversioncommand: *gccdumpversion
|
|
||||||
programs: *debiandefaultprograms
|
|
||||||
libraries: *debiandefaultlibraries
|
|
||||||
zorin:
|
|
||||||
id: zorin
|
|
||||||
releases:
|
|
||||||
default:
|
|
||||||
version: default
|
|
||||||
name: Zorin
|
|
||||||
gccversioncommand: *gccdumpversion
|
|
||||||
programs: *debiandefaultprograms
|
|
||||||
libraries: *debiandefaultlibraries
|
|
||||||
linuxmint:
|
|
||||||
id: linuxmint
|
|
||||||
releases:
|
|
||||||
default:
|
|
||||||
version: default
|
|
||||||
name: Linux Mint
|
|
||||||
gccversioncommand: *gccdumpversion
|
|
||||||
programs: *debiandefaultprograms
|
|
||||||
libraries: *debiandefaultlibraries
|
|
||||||
elementary:
|
|
||||||
id: elementary
|
|
||||||
releases:
|
|
||||||
default:
|
|
||||||
version: default
|
|
||||||
name: elementary OS
|
|
||||||
gccversioncommand: *gccdumpfullversion
|
|
||||||
programs: *debiandefaultprograms
|
|
||||||
libraries: *debiandefaultlibraries
|
|
||||||
void:
|
|
||||||
id: void
|
|
||||||
releases:
|
|
||||||
default:
|
|
||||||
version: default
|
|
||||||
name: VoidLinux
|
|
||||||
gccversioncommand: *gccdumpversion
|
|
||||||
programs:
|
|
||||||
- name: gcc
|
|
||||||
help: Please install with `xbps-install base-devel` and try again
|
|
||||||
- name: pkg-config
|
|
||||||
help: Please install with `xbps-install pkg-config` and try again
|
|
||||||
- name: npm
|
|
||||||
help: Please install with `xbps-install nodejs` and try again
|
|
||||||
libraries:
|
|
||||||
- name: gtk+3-devel
|
|
||||||
help: Please install with `xbps-install gtk+3-devel` and try again
|
|
||||||
- name: webkit2gtk-devel
|
|
||||||
help: Please install with `xbps-install webkit2gtk-devel` and try again
|
|
||||||
centos:
|
|
||||||
id: centos
|
|
||||||
releases:
|
|
||||||
default:
|
|
||||||
version: default
|
|
||||||
name: CentOS Linux
|
|
||||||
gccversioncommand: *gccdumpversion
|
|
||||||
programs:
|
|
||||||
- name: gcc
|
|
||||||
help: Please install with `sudo yum install gcc-c++ make` and try again
|
|
||||||
- name: pkg-config
|
|
||||||
help: Please install with `sudo yum install pkgconf-pkg-config` and try again
|
|
||||||
- name: npm
|
|
||||||
help: Please install with `sudo yum install epel-release && sudo yum install nodejs` and try again
|
|
||||||
libraries:
|
|
||||||
- name: gtk3-devel
|
|
||||||
help: Please install with `sudo yum install gtk3-devel` and try again
|
|
||||||
- name: webkitgtk3-devel
|
|
||||||
help: Please install with `sudo yum install webkitgtk3-devel` and try again
|
|
||||||
fedora:
|
|
||||||
id: fedora
|
|
||||||
releases:
|
|
||||||
default:
|
|
||||||
version: default
|
|
||||||
name: Fedora
|
|
||||||
gccversioncommand: *gccdumpfullversion
|
|
||||||
programs:
|
|
||||||
- name: gcc
|
|
||||||
help: Please install with `sudo yum install gcc-c++ make` and try again
|
|
||||||
- name: pkg-config
|
|
||||||
help: Please install with `sudo yum install pkgconf-pkg-config` and try again
|
|
||||||
- name: npm
|
|
||||||
help: Please install `sudo yum install nodejs` and try again
|
|
||||||
libraries:
|
|
||||||
- name: gtk3-devel
|
|
||||||
help: Please install with `sudo yum install gtk3-devel` and try again
|
|
||||||
- name: webkit2gtk3-devel
|
|
||||||
help: Please install with `sudo yum install webkit2gtk3-devel` and try again
|
|
||||||
arch:
|
|
||||||
id: arch
|
|
||||||
releases:
|
|
||||||
default:
|
|
||||||
version: default
|
|
||||||
name: Arch Linux
|
|
||||||
gccversioncommand: *gccdumpversion
|
|
||||||
programs:
|
|
||||||
- name: gcc
|
|
||||||
help: Please install with `sudo pacman -S gcc` and try again
|
|
||||||
- name: pkgconf
|
|
||||||
help: Please install with `sudo pacman -S pkgconf` and try again
|
|
||||||
- name: npm
|
|
||||||
help: Please install with `sudo pacman -S npm` and try again
|
|
||||||
libraries:
|
|
||||||
- name: gtk3
|
|
||||||
help: Please install with `sudo pacman -S gtk3` and try again
|
|
||||||
- name: webkit2gtk
|
|
||||||
help: Please install with `sudo pacman -S webkit2gtk` and try again
|
|
||||||
gentoo:
|
|
||||||
id: gentoo
|
|
||||||
releases:
|
|
||||||
default:
|
|
||||||
version: default
|
|
||||||
name: Gentoo
|
|
||||||
gccversioncommand: *gccdumpversion
|
|
||||||
programs:
|
|
||||||
- name: gcc
|
|
||||||
help: Please install using your system's package manager
|
|
||||||
- name: pkg-config
|
|
||||||
help: Please install using your system's package manager
|
|
||||||
- name: npm
|
|
||||||
help: Please install using your system's package manager
|
|
||||||
libraries:
|
|
||||||
- name: gtk+:3
|
|
||||||
help: Please install with `sudo emerge gtk+:3` and try again
|
|
||||||
- name: webkit-gtk
|
|
||||||
help: Please install with `sudo emerge webkit-gtk` and try again
|
|
||||||
@@ -1,81 +0,0 @@
|
|||||||
package cmd
|
|
||||||
|
|
||||||
import "testing"
|
|
||||||
|
|
||||||
func TestNewLinuxDB(t *testing.T) {
|
|
||||||
_ = NewLinuxDB()
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestKnownDistro(t *testing.T) {
|
|
||||||
var linuxDB = NewLinuxDB()
|
|
||||||
result := linuxDB.GetDistro("ubuntu")
|
|
||||||
if result == nil {
|
|
||||||
t.Error("Cannot get distro 'ubuntu'")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestUnknownDistro(t *testing.T) {
|
|
||||||
var linuxDB = NewLinuxDB()
|
|
||||||
result := linuxDB.GetDistro("unknown")
|
|
||||||
if result != nil {
|
|
||||||
t.Error("Should get nil for distribution 'unknown'")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestDefaultRelease(t *testing.T) {
|
|
||||||
var linuxDB = NewLinuxDB()
|
|
||||||
result := linuxDB.GetDistro("ubuntu")
|
|
||||||
if result == nil {
|
|
||||||
t.Error("Cannot get distro 'ubuntu'")
|
|
||||||
}
|
|
||||||
|
|
||||||
release := result.GetRelease("default")
|
|
||||||
if release == nil {
|
|
||||||
t.Error("Cannot get release 'default' for distro 'ubuntu'")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestUnknownRelease(t *testing.T) {
|
|
||||||
var linuxDB = NewLinuxDB()
|
|
||||||
result := linuxDB.GetDistro("ubuntu")
|
|
||||||
if result == nil {
|
|
||||||
t.Error("Cannot get distro 'ubuntu'")
|
|
||||||
}
|
|
||||||
|
|
||||||
release := result.GetRelease("16.04")
|
|
||||||
if release == nil {
|
|
||||||
t.Error("Failed to get release 'default' for unknown release version '16.04'")
|
|
||||||
}
|
|
||||||
|
|
||||||
if release.Version != "default" {
|
|
||||||
t.Errorf("Got version '%s' instead of 'default' for unknown release version '16.04'", result.ID)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestGetPrerequisites(t *testing.T) {
|
|
||||||
var linuxDB = NewLinuxDB()
|
|
||||||
result := linuxDB.GetDistro("debian")
|
|
||||||
if result == nil {
|
|
||||||
t.Error("Cannot get distro 'debian'")
|
|
||||||
}
|
|
||||||
|
|
||||||
release := result.GetRelease("default")
|
|
||||||
if release == nil {
|
|
||||||
t.Error("Failed to get release 'default' for unknown release version '16.04'")
|
|
||||||
}
|
|
||||||
|
|
||||||
if release.Version != "default" {
|
|
||||||
t.Errorf("Got version '%s' instead of 'default' for unknown release version '16.04'", result.ID)
|
|
||||||
}
|
|
||||||
|
|
||||||
if release.Name != "Debian" {
|
|
||||||
t.Errorf("Got Release Name '%s' instead of 'debian' for unknown release version '16.04'", release.Name)
|
|
||||||
}
|
|
||||||
|
|
||||||
if len(release.Programs) != 3 {
|
|
||||||
t.Errorf("Expected %d programs for unknown release version '16.04'", len(release.Programs))
|
|
||||||
}
|
|
||||||
if len(release.Libraries) != 2 {
|
|
||||||
t.Errorf("Expected %d libraries for unknown release version '16.04'", len(release.Libraries))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -5,6 +5,13 @@ import (
|
|||||||
"runtime"
|
"runtime"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// Prerequisite defines a Prerequisite!
|
||||||
|
type Prerequisite struct {
|
||||||
|
Name string
|
||||||
|
Help string
|
||||||
|
Path string
|
||||||
|
}
|
||||||
|
|
||||||
func newPrerequisite(name, help string) *Prerequisite {
|
func newPrerequisite(name, help string) *Prerequisite {
|
||||||
return &Prerequisite{Name: name, Help: help}
|
return &Prerequisite{Name: name, Help: help}
|
||||||
}
|
}
|
||||||
@@ -41,13 +48,31 @@ func getRequiredProgramsOSX() *Prerequisites {
|
|||||||
func getRequiredProgramsLinux() *Prerequisites {
|
func getRequiredProgramsLinux() *Prerequisites {
|
||||||
result := &Prerequisites{}
|
result := &Prerequisites{}
|
||||||
distroInfo := GetLinuxDistroInfo()
|
distroInfo := GetLinuxDistroInfo()
|
||||||
if distroInfo.Distribution != Unknown {
|
switch distroInfo.Distribution {
|
||||||
var linuxDB = NewLinuxDB()
|
case Debian:
|
||||||
distro := linuxDB.GetDistro(distroInfo.ID)
|
result.Add(newPrerequisite("gcc", "Please install with `sudo apt install build-essentials` and try again"))
|
||||||
release := distro.GetRelease(distroInfo.Release)
|
result.Add(newPrerequisite("pkg-config", "Please install with `sudo apt install pkg-config` and try again"))
|
||||||
for _, program := range release.Programs {
|
result.Add(newPrerequisite("npm", "Please install with `curl -sL https://deb.nodesource.com/setup_12.x | sudo bash - && sudo apt-get install -y nodejs` and try again"))
|
||||||
result.Add(program)
|
case Ubuntu:
|
||||||
}
|
result.Add(newPrerequisite("gcc", "Please install with `sudo apt install build-essentials` and try again"))
|
||||||
|
result.Add(newPrerequisite("pkg-config", "Please install with `sudo apt install pkg-config` and try again"))
|
||||||
|
result.Add(newPrerequisite("npm", "Please install with `curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash - && sudo apt-get install -y nodejs` and try again"))
|
||||||
|
case Zorin:
|
||||||
|
result.Add(newPrerequisite("gcc", "Please install with `sudo apt install build-essentials` and try again"))
|
||||||
|
result.Add(newPrerequisite("pkg-config", "Please install with `sudo apt install pkg-config` and try again"))
|
||||||
|
result.Add(newPrerequisite("npm", "Please install with `sudo snap install node --channel=12/stable --classic` and try again"))
|
||||||
|
case Fedora:
|
||||||
|
result.Add(newPrerequisite("gcc", "Please install with `sudo yum install gcc-c++ make` and try again"))
|
||||||
|
result.Add(newPrerequisite("pkg-config", "Please install with `sudo yum install pkgconf-pkg-config` and try again"))
|
||||||
|
result.Add(newPrerequisite("npm", "Please install with `curl -sL https://rpm.nodesource.com/setup_12.x | sudo bash - && sudo yum install -y nodejs` and try again"))
|
||||||
|
case CentOS:
|
||||||
|
result.Add(newPrerequisite("gcc", "Please install with `sudo yum install gcc gcc-c++ make` and try again"))
|
||||||
|
result.Add(newPrerequisite("pkg-config", "Please install with `sudo yum install pkgconfig` and try again"))
|
||||||
|
result.Add(newPrerequisite("npm", "Please install with `curl -sL https://rpm.nodesource.com/setup_12.x | sudo bash - && sudo yum install -y nodejs` and try again"))
|
||||||
|
default:
|
||||||
|
result.Add(newPrerequisite("gcc", "Please install with your system package manager and try again"))
|
||||||
|
result.Add(newPrerequisite("pkg-config", "Please install with your system package manager and try again"))
|
||||||
|
result.Add(newPrerequisite("npm", "Please install from https://nodejs.org/en/download/ and try again"))
|
||||||
}
|
}
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
@@ -81,15 +106,32 @@ func getRequiredLibrariesOSX() (*Prerequisites, error) {
|
|||||||
|
|
||||||
func getRequiredLibrariesLinux() (*Prerequisites, error) {
|
func getRequiredLibrariesLinux() (*Prerequisites, error) {
|
||||||
result := &Prerequisites{}
|
result := &Prerequisites{}
|
||||||
// The Linux Distribution DB
|
|
||||||
distroInfo := GetLinuxDistroInfo()
|
distroInfo := GetLinuxDistroInfo()
|
||||||
if distroInfo.Distribution != Unknown {
|
switch distroInfo.Distribution {
|
||||||
var linuxDB = NewLinuxDB()
|
case Debian:
|
||||||
distro := linuxDB.GetDistro(distroInfo.ID)
|
result.Add(newPrerequisite("libgtk-3-dev", "Please install with `sudo apt install libgtk-3-dev` and try again"))
|
||||||
release := distro.GetRelease(distroInfo.Release)
|
result.Add(newPrerequisite("libwebkit2gtk-4.0-dev", "Please install with `sudo apt install libwebkit2gtk-4.0-dev` and try again"))
|
||||||
for _, library := range release.Libraries {
|
case Ubuntu:
|
||||||
result.Add(library)
|
result.Add(newPrerequisite("libgtk-3-dev", "Please install with `sudo apt install libgtk-3-dev` and try again"))
|
||||||
}
|
result.Add(newPrerequisite("libwebkit2gtk-4.0-dev", "Please install with `sudo apt install libwebkit2gtk-4.0-dev` and try again"))
|
||||||
|
case Zorin:
|
||||||
|
result.Add(newPrerequisite("libgtk-3-dev", "Please install with `sudo apt install libgtk-3-dev` and try again"))
|
||||||
|
result.Add(newPrerequisite("libwebkit2gtk-4.0-dev", "Please install with `sudo apt install libwebkit2gtk-4.0-dev` and try again"))
|
||||||
|
case Gentoo:
|
||||||
|
result.Add(newPrerequisite("gtk+:3", "Please install with `sudo emerge gtk+:3` and try again"))
|
||||||
|
result.Add(newPrerequisite("webkit-gtk", "Please install with `sudo emerge webkit-gtk` and try again"))
|
||||||
|
case Arch:
|
||||||
|
result.Add(newPrerequisite("gtk3", "Please install with `sudo pacman -S gtk3` and try again"))
|
||||||
|
result.Add(newPrerequisite("webkit2gtk", "Please install with `sudo pacman -S webkit2gtk` and try again"))
|
||||||
|
case Fedora:
|
||||||
|
result.Add(newPrerequisite("gtk3-devel", "Please install with `sudo yum install gtk3-devel` and try again"))
|
||||||
|
result.Add(newPrerequisite("webkit2gtk3-devel", "Please install with `sudo yum install webkit2gtk3-devel` and try again"))
|
||||||
|
case CentOS:
|
||||||
|
result.Add(newPrerequisite("gtk3-devel", "Please install with `sudo yum install gtk3-devel` and try again"))
|
||||||
|
result.Add(newPrerequisite("webkitgtk3-devel", "Please install with `sudo yum install webkitgtk3-devel` and try again"))
|
||||||
|
default:
|
||||||
|
result.Add(newPrerequisite("libgtk-3-dev", "Please install with your system package manager and try again"))
|
||||||
|
result.Add(newPrerequisite("libwebkit2gtk-4.0-dev", "Please install with your system package manager and try again"))
|
||||||
}
|
}
|
||||||
return result, nil
|
return result, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -112,9 +112,9 @@ func (ph *ProjectHelper) NewProjectOptions() *ProjectOptions {
|
|||||||
Description: "Enter your project description",
|
Description: "Enter your project description",
|
||||||
Version: "0.1.0",
|
Version: "0.1.0",
|
||||||
BinaryName: "",
|
BinaryName: "",
|
||||||
system: ph.system,
|
system: NewSystemHelper(),
|
||||||
log: ph.log,
|
log: NewLogger(),
|
||||||
templates: ph.templates,
|
templates: NewTemplateHelper(),
|
||||||
Author: &author{},
|
Author: &author{},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -269,35 +269,55 @@ func CheckDependencies(logger *Logger) (bool, error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return false, err
|
return false, err
|
||||||
}
|
}
|
||||||
|
|
||||||
var libraryChecker CheckPkgInstalled
|
|
||||||
distroInfo := GetLinuxDistroInfo()
|
distroInfo := GetLinuxDistroInfo()
|
||||||
|
|
||||||
switch distroInfo.Distribution {
|
|
||||||
case Ubuntu, Debian, Zorin, Parrot, Linuxmint, Elementary, Kali:
|
|
||||||
libraryChecker = DpkgInstalled
|
|
||||||
case Arch:
|
|
||||||
libraryChecker = PacmanInstalled
|
|
||||||
case CentOS, Fedora:
|
|
||||||
libraryChecker = RpmInstalled
|
|
||||||
case Gentoo:
|
|
||||||
libraryChecker = EqueryInstalled
|
|
||||||
case VoidLinux:
|
|
||||||
libraryChecker = XbpsInstalled
|
|
||||||
default:
|
|
||||||
return false, RequestSupportForDistribution(distroInfo)
|
|
||||||
}
|
|
||||||
|
|
||||||
for _, library := range *requiredLibraries {
|
for _, library := range *requiredLibraries {
|
||||||
installed, err := libraryChecker(library.Name)
|
switch distroInfo.Distribution {
|
||||||
if err != nil {
|
case Ubuntu, Zorin, Debian:
|
||||||
return false, err
|
installed, err := DpkgInstalled(library.Name)
|
||||||
}
|
if err != nil {
|
||||||
if !installed {
|
return false, err
|
||||||
errors = true
|
}
|
||||||
logger.Error("Library '%s' not found. %s", library.Name, library.Help)
|
if !installed {
|
||||||
} else {
|
errors = true
|
||||||
logger.Green("Library '%s' installed.", library.Name)
|
logger.Error("Library '%s' not found. %s", library.Name, library.Help)
|
||||||
|
} else {
|
||||||
|
logger.Green("Library '%s' installed.", library.Name)
|
||||||
|
}
|
||||||
|
case Arch:
|
||||||
|
installed, err := PacmanInstalled(library.Name)
|
||||||
|
if err != nil {
|
||||||
|
return false, err
|
||||||
|
}
|
||||||
|
if !installed {
|
||||||
|
errors = true
|
||||||
|
logger.Error("Library '%s' not found. %s", library.Name, library.Help)
|
||||||
|
} else {
|
||||||
|
logger.Green("Library '%s' installed.", library.Name)
|
||||||
|
}
|
||||||
|
case RedHat, Fedora, CentOS:
|
||||||
|
installed, err := RpmInstalled(library.Name)
|
||||||
|
if err != nil {
|
||||||
|
return false, err
|
||||||
|
}
|
||||||
|
if !installed {
|
||||||
|
errors = true
|
||||||
|
logger.Error("Library '%s' not found. %s", library.Name, library.Help)
|
||||||
|
} else {
|
||||||
|
logger.Green("Library '%s' installed.", library.Name)
|
||||||
|
}
|
||||||
|
case Gentoo:
|
||||||
|
installed, err := EqueryInstalled(library.Name)
|
||||||
|
if err != nil {
|
||||||
|
return false, err
|
||||||
|
}
|
||||||
|
if !installed {
|
||||||
|
errors = true
|
||||||
|
logger.Error("Library '%s' not found. %s", library.Name, library.Help)
|
||||||
|
} else {
|
||||||
|
logger.Green("Library '%s' installed.", library.Name)
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
return false, RequestSupportForDistribution(distroInfo, library.Name)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ func NewTemplateHelper() *TemplateHelper {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// IsValidTemplate returns true if the given template name resides on disk
|
// IsValidTemplate returns true if the given tempalte name resides on disk
|
||||||
func (t *TemplateHelper) IsValidTemplate(templateName string) bool {
|
func (t *TemplateHelper) IsValidTemplate(templateName string) bool {
|
||||||
pathToTemplate := filepath.Join(t.templateDir.fullPath, templateName)
|
pathToTemplate := filepath.Join(t.templateDir.fullPath, templateName)
|
||||||
return t.fs.DirExists(pathToTemplate)
|
return t.fs.DirExists(pathToTemplate)
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
package cmd
|
package cmd
|
||||||
|
|
||||||
// Version - Wails version
|
// Version - Wails version
|
||||||
const Version = "v0.17.14-pre"
|
const Version = "v0.17.9-pre"
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"runtime"
|
"runtime"
|
||||||
|
|
||||||
"github.com/wailsapp/wails/cmd"
|
"github.com/wailsapp/wails/cmd"
|
||||||
@@ -23,7 +24,7 @@ func init() {
|
|||||||
|
|
||||||
system := cmd.NewSystemHelper()
|
system := cmd.NewSystemHelper()
|
||||||
err = system.Initialise()
|
err = system.Initialise()
|
||||||
if err != nil {
|
if err == nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -32,9 +33,23 @@ Create your first project by running 'wails init'.`
|
|||||||
if runtime.GOOS != "windows" {
|
if runtime.GOOS != "windows" {
|
||||||
successMessage = "🚀 " + successMessage
|
successMessage = "🚀 " + successMessage
|
||||||
}
|
}
|
||||||
|
// Platform check
|
||||||
|
err = platformCheck()
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
// Chrck for programs and libraries dependencies
|
// Check we have a cgo capable environment
|
||||||
errors, err := cmd.CheckDependencies(logger)
|
logger.Yellow("Checking for prerequisites...")
|
||||||
|
var requiredProgramErrors bool
|
||||||
|
requiredProgramErrors, err = checkRequiredPrograms()
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
// Linux has library deps
|
||||||
|
var libraryErrors bool
|
||||||
|
libraryErrors, err = checkLibraries()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@@ -45,14 +60,76 @@ Create your first project by running 'wails init'.`
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
logger.White("")
|
||||||
|
|
||||||
// Check for errors
|
// Check for errors
|
||||||
// CheckDependencies() returns !errors
|
var errors = libraryErrors || requiredProgramErrors
|
||||||
// so to get the right message in this
|
if !errors {
|
||||||
// check we have to do it in reversed
|
|
||||||
if errors {
|
|
||||||
logger.Yellow(successMessage)
|
logger.Yellow(successMessage)
|
||||||
}
|
}
|
||||||
|
|
||||||
return err
|
return err
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func platformCheck() error {
|
||||||
|
switch runtime.GOOS {
|
||||||
|
case "darwin":
|
||||||
|
logger.Yellow("Detected Platform: OSX")
|
||||||
|
case "windows":
|
||||||
|
logger.Yellow("Detected Platform: Windows")
|
||||||
|
case "linux":
|
||||||
|
logger.Yellow("Detected Platform: Linux")
|
||||||
|
default:
|
||||||
|
return fmt.Errorf("Platform %s is currently not supported", runtime.GOOS)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func checkLibraries() (errors bool, err error) {
|
||||||
|
if runtime.GOOS == "linux" {
|
||||||
|
// Check library prerequisites
|
||||||
|
requiredLibraries, err := cmd.GetRequiredLibraries()
|
||||||
|
if err != nil {
|
||||||
|
return false, err
|
||||||
|
}
|
||||||
|
distroInfo := cmd.GetLinuxDistroInfo()
|
||||||
|
for _, library := range *requiredLibraries {
|
||||||
|
switch distroInfo.Distribution {
|
||||||
|
case cmd.Ubuntu, cmd.Zorin, cmd.Debian:
|
||||||
|
installed, err := cmd.DpkgInstalled(library.Name)
|
||||||
|
if err != nil {
|
||||||
|
return false, err
|
||||||
|
}
|
||||||
|
if !installed {
|
||||||
|
errors = true
|
||||||
|
logger.Red("Library '%s' not found. %s", library.Name, library.Help)
|
||||||
|
} else {
|
||||||
|
logger.Green("Library '%s' installed.", library.Name)
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
return false, cmd.RequestSupportForDistribution(distroInfo, library.Name)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func checkRequiredPrograms() (errors bool, err error) {
|
||||||
|
requiredPrograms, err := cmd.GetRequiredPrograms()
|
||||||
|
if err != nil {
|
||||||
|
return true, err
|
||||||
|
}
|
||||||
|
errors = false
|
||||||
|
programHelper := cmd.NewProgramHelper()
|
||||||
|
for _, program := range *requiredPrograms {
|
||||||
|
bin := programHelper.FindProgram(program.Name)
|
||||||
|
if bin == nil {
|
||||||
|
errors = true
|
||||||
|
logger.Red("Program '%s' not found. %s", program.Name, program.Help)
|
||||||
|
} else {
|
||||||
|
logger.Green("Program '%s' found: %s", program.Name, bin.Path)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|||||||
@@ -42,12 +42,10 @@ To help you in this process, we will ask for some information, add Go/Wails deta
|
|||||||
gomodule = "(Not Set)"
|
gomodule = "(Not Set)"
|
||||||
}
|
}
|
||||||
|
|
||||||
// get version numbers for GCC, node & npm
|
// Get versions for GCC, node & npm
|
||||||
program := cmd.NewProgramHelper()
|
program := cmd.NewProgramHelper()
|
||||||
// string helpers
|
|
||||||
var gccVersion, nodeVersion, npmVersion string
|
var gccVersion, nodeVersion, npmVersion string
|
||||||
|
|
||||||
// choose between OS (mac,linux,win)
|
|
||||||
switch runtime.GOOS {
|
switch runtime.GOOS {
|
||||||
case "darwin":
|
case "darwin":
|
||||||
gcc := program.FindProgram("gcc")
|
gcc := program.FindProgram("gcc")
|
||||||
@@ -56,25 +54,14 @@ To help you in this process, we will ask for some information, add Go/Wails deta
|
|||||||
gccVersion = strings.TrimSpace(stdout)
|
gccVersion = strings.TrimSpace(stdout)
|
||||||
}
|
}
|
||||||
case "linux":
|
case "linux":
|
||||||
// for linux we have to collect
|
gcc := program.FindProgram("gcc")
|
||||||
// the distribution name
|
if gcc != nil {
|
||||||
distroInfo := cmd.GetLinuxDistroInfo()
|
gccVersion, _, _, _ := gcc.Run("-dumpfullversion")
|
||||||
linuxDB := cmd.NewLinuxDB()
|
gccVersion = gccVersion[:len(gccVersion)-1]
|
||||||
distro := linuxDB.GetDistro(distroInfo.ID)
|
gccVersion = strings.TrimSpace(gccVersion)
|
||||||
release := distro.GetRelease(distroInfo.Release)
|
}
|
||||||
gccVersionCommand := release.GccVersionCommand
|
|
||||||
|
|
||||||
gcc := program.FindProgram("gcc")
|
// TODO: windows support
|
||||||
if gcc != nil {
|
|
||||||
stdout, _, _, _ := gcc.Run(gccVersionCommand)
|
|
||||||
gccVersion = strings.TrimSpace(stdout)
|
|
||||||
}
|
|
||||||
case "windows":
|
|
||||||
gcc := program.FindProgram("gcc")
|
|
||||||
if gcc != nil {
|
|
||||||
stdout, _, _, _ := gcc.Run("-dumpversion")
|
|
||||||
gccVersion = strings.TrimSpace(stdout)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
npm := program.FindProgram("npm")
|
npm := program.FindProgram("npm")
|
||||||
|
|||||||
2
go.mod
2
go.mod
@@ -22,9 +22,9 @@ require (
|
|||||||
github.com/pkg/errors v0.8.1 // indirect
|
github.com/pkg/errors v0.8.1 // indirect
|
||||||
github.com/sirupsen/logrus v1.4.1
|
github.com/sirupsen/logrus v1.4.1
|
||||||
github.com/stretchr/testify v1.3.0 // indirect
|
github.com/stretchr/testify v1.3.0 // indirect
|
||||||
|
github.com/wailsapp/webview v0.2.7
|
||||||
golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529 // indirect
|
golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529 // indirect
|
||||||
golang.org/x/net v0.0.0-20190509222800-a4d6f7feada5 // indirect
|
golang.org/x/net v0.0.0-20190509222800-a4d6f7feada5 // indirect
|
||||||
golang.org/x/sys v0.0.0-20190509141414-a5b02f93d862
|
golang.org/x/sys v0.0.0-20190509141414-a5b02f93d862
|
||||||
gopkg.in/AlecAivazis/survey.v1 v1.8.4
|
gopkg.in/AlecAivazis/survey.v1 v1.8.4
|
||||||
gopkg.in/yaml.v3 v3.0.0-20190709130402-674ba3eaed22
|
|
||||||
)
|
)
|
||||||
|
|||||||
7
go.sum
7
go.sum
@@ -68,6 +68,9 @@ github.com/stretchr/testify v1.2.1/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXf
|
|||||||
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
||||||
github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q=
|
github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q=
|
||||||
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
|
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
|
||||||
|
github.com/wailsapp/webview v0.2.7 h1:fN5L5H9Oivg9IJPk7uaXQnjqB68Fny11ZWkIaTIZHmk=
|
||||||
|
github.com/wailsapp/webview v0.2.7/go.mod h1:XO9HJbKWokDxUYTWQEBCYg95n/To1v7PxvanDNVf8hY=
|
||||||
|
github.com/zserge/webview v0.0.0-20190123072648-16c93bcaeaeb/go.mod h1:a1CV8KR4Dd1eP2g+mEijGOp+HKczwdKHWyx0aPHKvo4=
|
||||||
golang.org/x/crypto v0.0.0-20190123085648-057139ce5d2b/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
golang.org/x/crypto v0.0.0-20190123085648-057139ce5d2b/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
||||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||||
golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529 h1:iMGN4xG0cnqj3t+zOM8wUB0BiPKHEwSxEZCvzcbZuvk=
|
golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529 h1:iMGN4xG0cnqj3t+zOM8wUB0BiPKHEwSxEZCvzcbZuvk=
|
||||||
@@ -86,7 +89,3 @@ golang.org/x/sys v0.0.0-20190509141414-a5b02f93d862/go.mod h1:h1NjWce9XRLGQEsW7w
|
|||||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||||
gopkg.in/AlecAivazis/survey.v1 v1.8.4 h1:10xXXN3wgIhPheb5NI58zFgZv32Ana7P3Tl4shW+0Qc=
|
gopkg.in/AlecAivazis/survey.v1 v1.8.4 h1:10xXXN3wgIhPheb5NI58zFgZv32Ana7P3Tl4shW+0Qc=
|
||||||
gopkg.in/AlecAivazis/survey.v1 v1.8.4/go.mod h1:iBNOmqKz/NUbZx3bA+4hAGLRC7fSK7tgtVDT4tB22XA=
|
gopkg.in/AlecAivazis/survey.v1 v1.8.4/go.mod h1:iBNOmqKz/NUbZx3bA+4hAGLRC7fSK7tgtVDT4tB22XA=
|
||||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
|
|
||||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
|
||||||
gopkg.in/yaml.v3 v3.0.0-20190709130402-674ba3eaed22 h1:0efs3hwEZhFKsCoP8l6dDB1AZWMgnEl3yWXWRZTOaEA=
|
|
||||||
gopkg.in/yaml.v3 v3.0.0-20190709130402-674ba3eaed22/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
|
||||||
|
|||||||
@@ -5,9 +5,9 @@ import (
|
|||||||
"reflect"
|
"reflect"
|
||||||
"unicode"
|
"unicode"
|
||||||
|
|
||||||
"github.com/wailsapp/wails/lib/interfaces"
|
|
||||||
"github.com/wailsapp/wails/lib/logger"
|
"github.com/wailsapp/wails/lib/logger"
|
||||||
"github.com/wailsapp/wails/lib/messages"
|
"github.com/wailsapp/wails/lib/messages"
|
||||||
|
"github.com/wailsapp/wails/lib/interfaces"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Manager handles method binding
|
// Manager handles method binding
|
||||||
@@ -195,11 +195,7 @@ func (b *Manager) processFunctionCall(callData *messages.CallData) (interface{},
|
|||||||
return nil, errorResult.Interface().(error)
|
return nil, errorResult.Interface().(error)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// fmt.Printf("result = '%+v'\n", result)
|
return result[0].Interface(), nil
|
||||||
if len(result) > 0 {
|
|
||||||
return result[0].Interface(), nil
|
|
||||||
}
|
|
||||||
return nil, nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *Manager) processMethodCall(callData *messages.CallData) (interface{}, error) {
|
func (b *Manager) processMethodCall(callData *messages.CallData) (interface{}, error) {
|
||||||
|
|||||||
@@ -13,13 +13,13 @@ import (
|
|||||||
"github.com/wailsapp/wails/lib/interfaces"
|
"github.com/wailsapp/wails/lib/interfaces"
|
||||||
"github.com/wailsapp/wails/lib/logger"
|
"github.com/wailsapp/wails/lib/logger"
|
||||||
"github.com/wailsapp/wails/lib/messages"
|
"github.com/wailsapp/wails/lib/messages"
|
||||||
wv "github.com/wailsapp/wails/lib/renderer/webview"
|
"github.com/wailsapp/webview"
|
||||||
)
|
)
|
||||||
|
|
||||||
// WebView defines the main webview application window
|
// WebView defines the main webview application window
|
||||||
// Default values in []
|
// Default values in []
|
||||||
type WebView struct {
|
type WebView struct {
|
||||||
window wv.WebView // The webview object
|
window webview.WebView // The webview object
|
||||||
ipc interfaces.IPCManager
|
ipc interfaces.IPCManager
|
||||||
log *logger.CustomLogger
|
log *logger.CustomLogger
|
||||||
config interfaces.AppConfig
|
config interfaces.AppConfig
|
||||||
@@ -49,14 +49,14 @@ func (w *WebView) Initialise(config interfaces.AppConfig, ipc interfaces.IPCMana
|
|||||||
w.config = config
|
w.config = config
|
||||||
|
|
||||||
// Create the WebView instance
|
// Create the WebView instance
|
||||||
w.window = wv.NewWebview(wv.Settings{
|
w.window = webview.NewWebview(webview.Settings{
|
||||||
Width: config.GetWidth(),
|
Width: config.GetWidth(),
|
||||||
Height: config.GetHeight(),
|
Height: config.GetHeight(),
|
||||||
Title: config.GetTitle(),
|
Title: config.GetTitle(),
|
||||||
Resizable: config.GetResizable(),
|
Resizable: config.GetResizable(),
|
||||||
URL: config.GetDefaultHTML(),
|
URL: config.GetDefaultHTML(),
|
||||||
Debug: !config.GetDisableInspector(),
|
Debug: !config.GetDisableInspector(),
|
||||||
ExternalInvokeCallback: func(_ wv.WebView, message string) {
|
ExternalInvokeCallback: func(_ webview.WebView, message string) {
|
||||||
w.ipc.Dispatch(message)
|
w.ipc.Dispatch(message)
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
@@ -246,7 +246,7 @@ func (w *WebView) SelectFile() string {
|
|||||||
wg.Add(1)
|
wg.Add(1)
|
||||||
go func() {
|
go func() {
|
||||||
w.window.Dispatch(func() {
|
w.window.Dispatch(func() {
|
||||||
result = w.window.Dialog(wv.DialogTypeOpen, 0, "Select File", "")
|
result = w.window.Dialog(webview.DialogTypeOpen, 0, "Select File", "")
|
||||||
wg.Done()
|
wg.Done()
|
||||||
})
|
})
|
||||||
}()
|
}()
|
||||||
@@ -264,7 +264,7 @@ func (w *WebView) SelectDirectory() string {
|
|||||||
wg.Add(1)
|
wg.Add(1)
|
||||||
go func() {
|
go func() {
|
||||||
w.window.Dispatch(func() {
|
w.window.Dispatch(func() {
|
||||||
result = w.window.Dialog(wv.DialogTypeOpen, wv.DialogFlagDirectory, "Select Directory", "")
|
result = w.window.Dialog(webview.DialogTypeOpen, webview.DialogFlagDirectory, "Select Directory", "")
|
||||||
wg.Done()
|
wg.Done()
|
||||||
})
|
})
|
||||||
}()
|
}()
|
||||||
@@ -282,7 +282,7 @@ func (w *WebView) SelectSaveFile() string {
|
|||||||
wg.Add(1)
|
wg.Add(1)
|
||||||
go func() {
|
go func() {
|
||||||
w.window.Dispatch(func() {
|
w.window.Dispatch(func() {
|
||||||
result = w.window.Dialog(wv.DialogTypeSave, 0, "Save file", "")
|
result = w.window.Dialog(webview.DialogTypeSave, 0, "Save file", "")
|
||||||
wg.Done()
|
wg.Done()
|
||||||
})
|
})
|
||||||
}()
|
}()
|
||||||
|
|||||||
@@ -1,21 +0,0 @@
|
|||||||
MIT License
|
|
||||||
|
|
||||||
Copyright (c) 2017 Serge Zaitsev
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all
|
|
||||||
copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
SOFTWARE.
|
|
||||||
@@ -1,372 +0,0 @@
|
|||||||
// Package wails implements Go bindings to https://github.com/zserge/webview C library.
|
|
||||||
// It is a modified version of webview.go from that repository
|
|
||||||
|
|
||||||
// Bindings closely repeat the C APIs and include both, a simplified
|
|
||||||
// single-function API to just open a full-screen webview window, and a more
|
|
||||||
// advanced and featureful set of APIs, including Go-to-JavaScript bindings.
|
|
||||||
//
|
|
||||||
// The library uses gtk-webkit, Cocoa/Webkit and MSHTML (IE8..11) as a browser
|
|
||||||
// engine and supports Linux, MacOS and Windows 7..10 respectively.
|
|
||||||
//
|
|
||||||
package webview
|
|
||||||
|
|
||||||
/*
|
|
||||||
#cgo linux openbsd freebsd CFLAGS: -DWEBVIEW_GTK=1
|
|
||||||
#cgo linux openbsd freebsd pkg-config: gtk+-3.0 webkit2gtk-4.0
|
|
||||||
|
|
||||||
#cgo windows CFLAGS: -DWEBVIEW_WINAPI=1
|
|
||||||
#cgo windows LDFLAGS: -lole32 -lcomctl32 -loleaut32 -luuid -lgdi32
|
|
||||||
|
|
||||||
#cgo darwin CFLAGS: -DWEBVIEW_COCOA=1 -x objective-c
|
|
||||||
#cgo darwin LDFLAGS: -framework Cocoa -framework WebKit
|
|
||||||
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <stdint.h>
|
|
||||||
#define WEBVIEW_STATIC
|
|
||||||
#define WEBVIEW_IMPLEMENTATION
|
|
||||||
#include "webview.h"
|
|
||||||
|
|
||||||
extern void _webviewExternalInvokeCallback(void *, void *);
|
|
||||||
|
|
||||||
static inline void CgoWebViewFree(void *w) {
|
|
||||||
free((void *)((struct webview *)w)->title);
|
|
||||||
free((void *)((struct webview *)w)->url);
|
|
||||||
free(w);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void *CgoWebViewCreate(int width, int height, char *title, char *url, int resizable, int debug) {
|
|
||||||
struct webview *w = (struct webview *) calloc(1, sizeof(*w));
|
|
||||||
w->width = width;
|
|
||||||
w->height = height;
|
|
||||||
w->title = title;
|
|
||||||
w->url = url;
|
|
||||||
w->resizable = resizable;
|
|
||||||
w->debug = debug;
|
|
||||||
w->external_invoke_cb = (webview_external_invoke_cb_t) _webviewExternalInvokeCallback;
|
|
||||||
if (webview_init(w) != 0) {
|
|
||||||
CgoWebViewFree(w);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
return (void *)w;
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline int CgoWebViewLoop(void *w, int blocking) {
|
|
||||||
return webview_loop((struct webview *)w, blocking);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void CgoWebViewTerminate(void *w) {
|
|
||||||
webview_terminate((struct webview *)w);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void CgoWebViewExit(void *w) {
|
|
||||||
webview_exit((struct webview *)w);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void CgoWebViewSetTitle(void *w, char *title) {
|
|
||||||
webview_set_title((struct webview *)w, title);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void CgoWebViewSetFullscreen(void *w, int fullscreen) {
|
|
||||||
webview_set_fullscreen((struct webview *)w, fullscreen);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void CgoWebViewSetColor(void *w, uint8_t r, uint8_t g, uint8_t b, uint8_t a) {
|
|
||||||
webview_set_color((struct webview *)w, r, g, b, a);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void CgoDialog(void *w, int dlgtype, int flags,
|
|
||||||
char *title, char *arg, char *res, size_t ressz) {
|
|
||||||
webview_dialog(w, dlgtype, flags,
|
|
||||||
(const char*)title, (const char*) arg, res, ressz);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline int CgoWebViewEval(void *w, char *js) {
|
|
||||||
return webview_eval((struct webview *)w, js);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void CgoWebViewInjectCSS(void *w, char *css) {
|
|
||||||
webview_inject_css((struct webview *)w, css);
|
|
||||||
}
|
|
||||||
|
|
||||||
extern void _webviewDispatchGoCallback(void *);
|
|
||||||
static inline void _webview_dispatch_cb(struct webview *w, void *arg) {
|
|
||||||
_webviewDispatchGoCallback(arg);
|
|
||||||
}
|
|
||||||
static inline void CgoWebViewDispatch(void *w, uintptr_t arg) {
|
|
||||||
webview_dispatch((struct webview *)w, _webview_dispatch_cb, (void *)arg);
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
import "C"
|
|
||||||
import (
|
|
||||||
"errors"
|
|
||||||
"runtime"
|
|
||||||
"sync"
|
|
||||||
"unsafe"
|
|
||||||
)
|
|
||||||
|
|
||||||
func init() {
|
|
||||||
// Ensure that main.main is called from the main thread
|
|
||||||
runtime.LockOSThread()
|
|
||||||
}
|
|
||||||
|
|
||||||
// Open is a simplified API to open a single native window with a full-size webview in
|
|
||||||
// it. It can be helpful if you want to communicate with the core app using XHR
|
|
||||||
// or WebSockets (as opposed to using JavaScript bindings).
|
|
||||||
//
|
|
||||||
// Window appearance can be customized using title, width, height and resizable parameters.
|
|
||||||
// URL must be provided and can user either a http or https protocol, or be a
|
|
||||||
// local file:// URL. On some platforms "data:" URLs are also supported
|
|
||||||
// (Linux/MacOS).
|
|
||||||
func Open(title, url string, w, h int, resizable bool) error {
|
|
||||||
titleStr := C.CString(title)
|
|
||||||
defer C.free(unsafe.Pointer(titleStr))
|
|
||||||
urlStr := C.CString(url)
|
|
||||||
defer C.free(unsafe.Pointer(urlStr))
|
|
||||||
resize := C.int(0)
|
|
||||||
if resizable {
|
|
||||||
resize = C.int(1)
|
|
||||||
}
|
|
||||||
|
|
||||||
r := C.webview(titleStr, urlStr, C.int(w), C.int(h), resize)
|
|
||||||
if r != 0 {
|
|
||||||
return errors.New("failed to create webview")
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// ExternalInvokeCallbackFunc is a function type that is called every time
|
|
||||||
// "window.external.invoke()" is called from JavaScript. Data is the only
|
|
||||||
// obligatory string parameter passed into the "invoke(data)" function from
|
|
||||||
// JavaScript. To pass more complex data serialized JSON or base64 encoded
|
|
||||||
// string can be used.
|
|
||||||
type ExternalInvokeCallbackFunc func(w WebView, data string)
|
|
||||||
|
|
||||||
// Settings is a set of parameters to customize the initial WebView appearance
|
|
||||||
// and behavior. It is passed into the webview.New() constructor.
|
|
||||||
type Settings struct {
|
|
||||||
// WebView main window title
|
|
||||||
Title string
|
|
||||||
// URL to open in a webview
|
|
||||||
URL string
|
|
||||||
// Window width in pixels
|
|
||||||
Width int
|
|
||||||
// Window height in pixels
|
|
||||||
Height int
|
|
||||||
// Allows/disallows window resizing
|
|
||||||
Resizable bool
|
|
||||||
// Enable debugging tools (Linux/BSD/MacOS, on Windows use Firebug)
|
|
||||||
Debug bool
|
|
||||||
// A callback that is executed when JavaScript calls "window.external.invoke()"
|
|
||||||
ExternalInvokeCallback ExternalInvokeCallbackFunc
|
|
||||||
}
|
|
||||||
|
|
||||||
// WebView is an interface that wraps the basic methods for controlling the UI
|
|
||||||
// loop, handling multithreading and providing JavaScript bindings.
|
|
||||||
type WebView interface {
|
|
||||||
// Run() starts the main UI loop until the user closes the webview window or
|
|
||||||
// Terminate() is called.
|
|
||||||
Run()
|
|
||||||
// Loop() runs a single iteration of the main UI.
|
|
||||||
Loop(blocking bool) bool
|
|
||||||
// SetTitle() changes window title. This method must be called from the main
|
|
||||||
// thread only. See Dispatch() for more details.
|
|
||||||
SetTitle(title string)
|
|
||||||
// SetFullscreen() controls window full-screen mode. This method must be
|
|
||||||
// called from the main thread only. See Dispatch() for more details.
|
|
||||||
SetFullscreen(fullscreen bool)
|
|
||||||
// SetColor() changes window background color. This method must be called from
|
|
||||||
// the main thread only. See Dispatch() for more details.
|
|
||||||
SetColor(r, g, b, a uint8)
|
|
||||||
// Eval() evaluates an arbitrary JS code inside the webview. This method must
|
|
||||||
// be called from the main thread only. See Dispatch() for more details.
|
|
||||||
Eval(js string) error
|
|
||||||
// InjectJS() injects an arbitrary block of CSS code using the JS API. This
|
|
||||||
// method must be called from the main thread only. See Dispatch() for more
|
|
||||||
// details.
|
|
||||||
InjectCSS(css string)
|
|
||||||
// Dialog() opens a system dialog of the given type and title. String
|
|
||||||
// argument can be provided for certain dialogs, such as alert boxes. For
|
|
||||||
// alert boxes argument is a message inside the dialog box.
|
|
||||||
Dialog(dlgType DialogType, flags int, title string, arg string) string
|
|
||||||
// Terminate() breaks the main UI loop. This method must be called from the main thread
|
|
||||||
// only. See Dispatch() for more details.
|
|
||||||
Terminate()
|
|
||||||
// Dispatch() schedules some arbitrary function to be executed on the main UI
|
|
||||||
// thread. This may be helpful if you want to run some JavaScript from
|
|
||||||
// background threads/goroutines, or to terminate the app.
|
|
||||||
Dispatch(func())
|
|
||||||
// Exit() closes the window and cleans up the resources. Use Terminate() to
|
|
||||||
// forcefully break out of the main UI loop.
|
|
||||||
Exit()
|
|
||||||
}
|
|
||||||
|
|
||||||
// DialogType is an enumeration of all supported system dialog types
|
|
||||||
type DialogType int
|
|
||||||
|
|
||||||
const (
|
|
||||||
// DialogTypeOpen is a system file open dialog
|
|
||||||
DialogTypeOpen DialogType = iota
|
|
||||||
// DialogTypeSave is a system file save dialog
|
|
||||||
DialogTypeSave
|
|
||||||
// DialogTypeAlert is a system alert dialog (message box)
|
|
||||||
DialogTypeAlert
|
|
||||||
)
|
|
||||||
|
|
||||||
const (
|
|
||||||
// DialogFlagFile is a normal file picker dialog
|
|
||||||
DialogFlagFile = C.WEBVIEW_DIALOG_FLAG_FILE
|
|
||||||
// DialogFlagDirectory is an open directory dialog
|
|
||||||
DialogFlagDirectory = C.WEBVIEW_DIALOG_FLAG_DIRECTORY
|
|
||||||
// DialogFlagInfo is an info alert dialog
|
|
||||||
DialogFlagInfo = C.WEBVIEW_DIALOG_FLAG_INFO
|
|
||||||
// DialogFlagWarning is a warning alert dialog
|
|
||||||
DialogFlagWarning = C.WEBVIEW_DIALOG_FLAG_WARNING
|
|
||||||
// DialogFlagError is an error dialog
|
|
||||||
DialogFlagError = C.WEBVIEW_DIALOG_FLAG_ERROR
|
|
||||||
)
|
|
||||||
|
|
||||||
var (
|
|
||||||
m sync.Mutex
|
|
||||||
index uintptr
|
|
||||||
fns = map[uintptr]func(){}
|
|
||||||
cbs = map[WebView]ExternalInvokeCallbackFunc{}
|
|
||||||
)
|
|
||||||
|
|
||||||
type webview struct {
|
|
||||||
w unsafe.Pointer
|
|
||||||
}
|
|
||||||
|
|
||||||
var _ WebView = &webview{}
|
|
||||||
|
|
||||||
func boolToInt(b bool) int {
|
|
||||||
if b {
|
|
||||||
return 1
|
|
||||||
}
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
// NewWebview creates and opens a new webview window using the given settings. The
|
|
||||||
// returned object implements the WebView interface. This function returns nil
|
|
||||||
// if a window can not be created.
|
|
||||||
func NewWebview(settings Settings) WebView {
|
|
||||||
if settings.Width == 0 {
|
|
||||||
settings.Width = 640
|
|
||||||
}
|
|
||||||
if settings.Height == 0 {
|
|
||||||
settings.Height = 480
|
|
||||||
}
|
|
||||||
if settings.Title == "" {
|
|
||||||
settings.Title = "WebView"
|
|
||||||
}
|
|
||||||
w := &webview{}
|
|
||||||
w.w = C.CgoWebViewCreate(C.int(settings.Width), C.int(settings.Height),
|
|
||||||
C.CString(settings.Title), C.CString(settings.URL),
|
|
||||||
C.int(boolToInt(settings.Resizable)), C.int(boolToInt(settings.Debug)))
|
|
||||||
m.Lock()
|
|
||||||
if settings.ExternalInvokeCallback != nil {
|
|
||||||
cbs[w] = settings.ExternalInvokeCallback
|
|
||||||
} else {
|
|
||||||
cbs[w] = func(w WebView, data string) {}
|
|
||||||
}
|
|
||||||
m.Unlock()
|
|
||||||
return w
|
|
||||||
}
|
|
||||||
|
|
||||||
func (w *webview) Loop(blocking bool) bool {
|
|
||||||
block := C.int(0)
|
|
||||||
if blocking {
|
|
||||||
block = 1
|
|
||||||
}
|
|
||||||
return C.CgoWebViewLoop(w.w, block) == 0
|
|
||||||
}
|
|
||||||
|
|
||||||
func (w *webview) Run() {
|
|
||||||
for w.Loop(true) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (w *webview) Exit() {
|
|
||||||
C.CgoWebViewExit(w.w)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (w *webview) Dispatch(f func()) {
|
|
||||||
m.Lock()
|
|
||||||
for ; fns[index] != nil; index++ {
|
|
||||||
}
|
|
||||||
fns[index] = f
|
|
||||||
m.Unlock()
|
|
||||||
C.CgoWebViewDispatch(w.w, C.uintptr_t(index))
|
|
||||||
}
|
|
||||||
|
|
||||||
func (w *webview) SetTitle(title string) {
|
|
||||||
p := C.CString(title)
|
|
||||||
defer C.free(unsafe.Pointer(p))
|
|
||||||
C.CgoWebViewSetTitle(w.w, p)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (w *webview) SetColor(r, g, b, a uint8) {
|
|
||||||
C.CgoWebViewSetColor(w.w, C.uint8_t(r), C.uint8_t(g), C.uint8_t(b), C.uint8_t(a))
|
|
||||||
}
|
|
||||||
|
|
||||||
func (w *webview) SetFullscreen(fullscreen bool) {
|
|
||||||
C.CgoWebViewSetFullscreen(w.w, C.int(boolToInt(fullscreen)))
|
|
||||||
}
|
|
||||||
|
|
||||||
func (w *webview) Dialog(dlgType DialogType, flags int, title string, arg string) string {
|
|
||||||
const maxPath = 4096
|
|
||||||
titlePtr := C.CString(title)
|
|
||||||
defer C.free(unsafe.Pointer(titlePtr))
|
|
||||||
argPtr := C.CString(arg)
|
|
||||||
defer C.free(unsafe.Pointer(argPtr))
|
|
||||||
resultPtr := (*C.char)(C.calloc((C.size_t)(unsafe.Sizeof((*C.char)(nil))), (C.size_t)(maxPath)))
|
|
||||||
defer C.free(unsafe.Pointer(resultPtr))
|
|
||||||
C.CgoDialog(w.w, C.int(dlgType), C.int(flags), titlePtr,
|
|
||||||
argPtr, resultPtr, C.size_t(maxPath))
|
|
||||||
return C.GoString(resultPtr)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (w *webview) Eval(js string) error {
|
|
||||||
p := C.CString(js)
|
|
||||||
defer C.free(unsafe.Pointer(p))
|
|
||||||
switch C.CgoWebViewEval(w.w, p) {
|
|
||||||
case -1:
|
|
||||||
return errors.New("evaluation failed")
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (w *webview) InjectCSS(css string) {
|
|
||||||
p := C.CString(css)
|
|
||||||
defer C.free(unsafe.Pointer(p))
|
|
||||||
C.CgoWebViewInjectCSS(w.w, p)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (w *webview) Terminate() {
|
|
||||||
C.CgoWebViewTerminate(w.w)
|
|
||||||
}
|
|
||||||
|
|
||||||
//export _webviewDispatchGoCallback
|
|
||||||
func _webviewDispatchGoCallback(index unsafe.Pointer) {
|
|
||||||
var f func()
|
|
||||||
m.Lock()
|
|
||||||
f = fns[uintptr(index)]
|
|
||||||
delete(fns, uintptr(index))
|
|
||||||
m.Unlock()
|
|
||||||
f()
|
|
||||||
}
|
|
||||||
|
|
||||||
//export _webviewExternalInvokeCallback
|
|
||||||
func _webviewExternalInvokeCallback(w unsafe.Pointer, data unsafe.Pointer) {
|
|
||||||
m.Lock()
|
|
||||||
var (
|
|
||||||
cb ExternalInvokeCallbackFunc
|
|
||||||
wv WebView
|
|
||||||
)
|
|
||||||
for wv, cb = range cbs {
|
|
||||||
if wv.(*webview).w == w {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
m.Unlock()
|
|
||||||
cb(wv, C.GoString((*C.char)(data)))
|
|
||||||
}
|
|
||||||
File diff suppressed because it is too large
Load Diff
197
runtime/js/package-lock.json
generated
197
runtime/js/package-lock.json
generated
@@ -1640,9 +1640,9 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"acorn-jsx": {
|
"acorn-jsx": {
|
||||||
"version": "5.0.2",
|
"version": "5.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.0.1.tgz",
|
||||||
"integrity": "sha512-tiNTrP1MP0QrChmD2DdupCr6HWSFeKVw5d/dHTu4Y7rkAkRhU/Dt7dphAfIUyxtHpl/eBVip5uTNSpQJHylpAw==",
|
"integrity": "sha512-HJ7CfNHrfJLlNTzIEUTj43LNWGkqpRLxm3YjAlcD0ACydk9XynzYsCBHxut+iqt+1aBXkx9UP/w/ZqMr13XIzg==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"ajv": {
|
"ajv": {
|
||||||
@@ -2881,9 +2881,9 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"eslint": {
|
"eslint": {
|
||||||
"version": "6.2.2",
|
"version": "6.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/eslint/-/eslint-6.2.2.tgz",
|
"resolved": "https://registry.npmjs.org/eslint/-/eslint-6.0.1.tgz",
|
||||||
"integrity": "sha512-mf0elOkxHbdyGX1IJEUsNBzCDdyoUgljF3rRlgfyYh0pwGnreLc0jjD6ZuleOibjmnUWZLY2eXwSooeOgGJ2jw==",
|
"integrity": "sha512-DyQRaMmORQ+JsWShYsSg4OPTjY56u1nCjAmICrE8vLWqyLKxhFXOthwMj1SA8xwfrv0CofLNVnqbfyhwCkaO0w==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"@babel/code-frame": "^7.0.0",
|
"@babel/code-frame": "^7.0.0",
|
||||||
@@ -2892,37 +2892,36 @@
|
|||||||
"cross-spawn": "^6.0.5",
|
"cross-spawn": "^6.0.5",
|
||||||
"debug": "^4.0.1",
|
"debug": "^4.0.1",
|
||||||
"doctrine": "^3.0.0",
|
"doctrine": "^3.0.0",
|
||||||
"eslint-scope": "^5.0.0",
|
"eslint-scope": "^4.0.3",
|
||||||
"eslint-utils": "^1.4.2",
|
"eslint-utils": "^1.3.1",
|
||||||
"eslint-visitor-keys": "^1.1.0",
|
"eslint-visitor-keys": "^1.0.0",
|
||||||
"espree": "^6.1.1",
|
"espree": "^6.0.0",
|
||||||
"esquery": "^1.0.1",
|
"esquery": "^1.0.1",
|
||||||
"esutils": "^2.0.2",
|
"esutils": "^2.0.2",
|
||||||
"file-entry-cache": "^5.0.1",
|
"file-entry-cache": "^5.0.1",
|
||||||
"functional-red-black-tree": "^1.0.1",
|
"functional-red-black-tree": "^1.0.1",
|
||||||
"glob-parent": "^5.0.0",
|
"glob-parent": "^3.1.0",
|
||||||
"globals": "^11.7.0",
|
"globals": "^11.7.0",
|
||||||
"ignore": "^4.0.6",
|
"ignore": "^4.0.6",
|
||||||
"import-fresh": "^3.0.0",
|
"import-fresh": "^3.0.0",
|
||||||
"imurmurhash": "^0.1.4",
|
"imurmurhash": "^0.1.4",
|
||||||
"inquirer": "^6.4.1",
|
"inquirer": "^6.2.2",
|
||||||
"is-glob": "^4.0.0",
|
"is-glob": "^4.0.0",
|
||||||
"js-yaml": "^3.13.1",
|
"js-yaml": "^3.13.1",
|
||||||
"json-stable-stringify-without-jsonify": "^1.0.1",
|
"json-stable-stringify-without-jsonify": "^1.0.1",
|
||||||
"levn": "^0.3.0",
|
"levn": "^0.3.0",
|
||||||
"lodash": "^4.17.14",
|
"lodash": "^4.17.11",
|
||||||
"minimatch": "^3.0.4",
|
"minimatch": "^3.0.4",
|
||||||
"mkdirp": "^0.5.1",
|
"mkdirp": "^0.5.1",
|
||||||
"natural-compare": "^1.4.0",
|
"natural-compare": "^1.4.0",
|
||||||
"optionator": "^0.8.2",
|
"optionator": "^0.8.2",
|
||||||
"progress": "^2.0.0",
|
"progress": "^2.0.0",
|
||||||
"regexpp": "^2.0.1",
|
"regexpp": "^2.0.1",
|
||||||
"semver": "^6.1.2",
|
"semver": "^5.5.1",
|
||||||
"strip-ansi": "^5.2.0",
|
"strip-ansi": "^4.0.0",
|
||||||
"strip-json-comments": "^3.0.1",
|
"strip-json-comments": "^2.0.1",
|
||||||
"table": "^5.2.3",
|
"table": "^5.2.3",
|
||||||
"text-table": "^0.2.0",
|
"text-table": "^0.2.0"
|
||||||
"v8-compile-cache": "^2.0.3"
|
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"debug": {
|
"debug": {
|
||||||
@@ -2934,33 +2933,11 @@
|
|||||||
"ms": "^2.1.1"
|
"ms": "^2.1.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"eslint-scope": {
|
|
||||||
"version": "5.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.0.0.tgz",
|
|
||||||
"integrity": "sha512-oYrhJW7S0bxAFDvWqzvMPRm6pcgcnWc4QnofCAqRTRfQC0JcwenzGglTtsLyIuuWFfkqDG9vz67cnttSd53djw==",
|
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
|
||||||
"esrecurse": "^4.1.0",
|
|
||||||
"estraverse": "^4.1.1"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"lodash": {
|
|
||||||
"version": "4.17.15",
|
|
||||||
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz",
|
|
||||||
"integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==",
|
|
||||||
"dev": true
|
|
||||||
},
|
|
||||||
"ms": {
|
"ms": {
|
||||||
"version": "2.1.2",
|
"version": "2.1.2",
|
||||||
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
|
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
|
||||||
"integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==",
|
"integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
|
||||||
"semver": {
|
|
||||||
"version": "6.3.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz",
|
|
||||||
"integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==",
|
|
||||||
"dev": true
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -2975,37 +2952,26 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"eslint-utils": {
|
"eslint-utils": {
|
||||||
"version": "1.4.2",
|
"version": "1.3.1",
|
||||||
"resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-1.4.2.tgz",
|
"resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-1.3.1.tgz",
|
||||||
"integrity": "sha512-eAZS2sEUMlIeCjBeubdj45dmBHQwPHWyBcT1VSYB7o9x9WRRqKxyUoiXlRjyAwzN7YEzHJlYg0NmzDRWx6GP4Q==",
|
"integrity": "sha512-Z7YjnIldX+2XMcjr7ZkgEsOj/bREONV60qYeB/bjMAqqqZ4zxKyWX+BOUkdmRmA9riiIPVvo5x86m5elviOk0Q==",
|
||||||
"dev": true,
|
"dev": true
|
||||||
"requires": {
|
|
||||||
"eslint-visitor-keys": "^1.0.0"
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"eslint-visitor-keys": {
|
"eslint-visitor-keys": {
|
||||||
"version": "1.1.0",
|
"version": "1.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz",
|
||||||
"integrity": "sha512-8y9YjtM1JBJU/A9Kc+SbaOV4y29sSWckBwMHa+FGtVj5gN/sbnKDf6xJUl+8g7FAij9LVaP8C24DUiH/f/2Z9A==",
|
"integrity": "sha512-qzm/XxIbxm/FHyH341ZrbnMUpe+5Bocte9xkmFMzPMjRaZMcXww+MpBptFvtU+79L362nqiLhekCxCxDPaUMBQ==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"espree": {
|
"espree": {
|
||||||
"version": "6.1.1",
|
"version": "6.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/espree/-/espree-6.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/espree/-/espree-6.0.0.tgz",
|
||||||
"integrity": "sha512-EYbr8XZUhWbYCqQRW0duU5LxzL5bETN6AjKBGy1302qqzPaCH10QbRg3Wvco79Z8x9WbiE8HYB4e75xl6qUYvQ==",
|
"integrity": "sha512-lJvCS6YbCn3ImT3yKkPe0+tJ+mH6ljhGNjHQH9mRtiO6gjhVAOhVXW1yjnwqGwTkK3bGbye+hb00nFNmu0l/1Q==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"acorn": "^7.0.0",
|
"acorn": "^6.0.7",
|
||||||
"acorn-jsx": "^5.0.2",
|
"acorn-jsx": "^5.0.0",
|
||||||
"eslint-visitor-keys": "^1.1.0"
|
"eslint-visitor-keys": "^1.0.0"
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"acorn": {
|
|
||||||
"version": "7.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/acorn/-/acorn-7.0.0.tgz",
|
|
||||||
"integrity": "sha512-PaF/MduxijYYt7unVGRuds1vBC9bFxbNf+VWqhOClfdgy7RlVkQqt610ig1/yxTgsDIfW1cWDel5EBbOy3jdtQ==",
|
|
||||||
"dev": true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"esprima": {
|
"esprima": {
|
||||||
@@ -4134,12 +4100,24 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"glob-parent": {
|
"glob-parent": {
|
||||||
"version": "5.0.0",
|
"version": "3.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz",
|
||||||
"integrity": "sha512-Z2RwiujPRGluePM6j699ktJYxmPpJKCfpGA13jz2hmFZC7gKetzrWvg5KN3+OsIFmydGyZ1AVwERCq1w/ZZwRg==",
|
"integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"is-glob": "^4.0.1"
|
"is-glob": "^3.1.0",
|
||||||
|
"path-dirname": "^1.0.0"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"is-glob": {
|
||||||
|
"version": "3.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz",
|
||||||
|
"integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"is-extglob": "^2.1.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"global-modules": {
|
"global-modules": {
|
||||||
@@ -4397,9 +4375,9 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"inquirer": {
|
"inquirer": {
|
||||||
"version": "6.5.2",
|
"version": "6.4.1",
|
||||||
"resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.5.2.tgz",
|
"resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.4.1.tgz",
|
||||||
"integrity": "sha512-cntlB5ghuB0iuO65Ovoi8ogLHiWGs/5yNrtUcKjFhSSiVeAIVpD7koaSU9RM8mpXw5YDi9RdYXGQMaOURB7ycQ==",
|
"integrity": "sha512-/Jw+qPZx4EDYsaT6uz7F4GJRNFMRdKNeUZw3ZnKV8lyuUgz/YWRCSUAJMZSVhSq4Ec0R2oYnyi6b3d4JXcL5Nw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"ansi-escapes": "^3.2.0",
|
"ansi-escapes": "^3.2.0",
|
||||||
@@ -4408,7 +4386,7 @@
|
|||||||
"cli-width": "^2.0.0",
|
"cli-width": "^2.0.0",
|
||||||
"external-editor": "^3.0.3",
|
"external-editor": "^3.0.3",
|
||||||
"figures": "^2.0.0",
|
"figures": "^2.0.0",
|
||||||
"lodash": "^4.17.12",
|
"lodash": "^4.17.11",
|
||||||
"mute-stream": "0.0.7",
|
"mute-stream": "0.0.7",
|
||||||
"run-async": "^2.2.0",
|
"run-async": "^2.2.0",
|
||||||
"rxjs": "^6.4.0",
|
"rxjs": "^6.4.0",
|
||||||
@@ -4417,12 +4395,6 @@
|
|||||||
"through": "^2.3.6"
|
"through": "^2.3.6"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"lodash": {
|
|
||||||
"version": "4.17.15",
|
|
||||||
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz",
|
|
||||||
"integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==",
|
|
||||||
"dev": true
|
|
||||||
},
|
|
||||||
"string-width": {
|
"string-width": {
|
||||||
"version": "2.1.1",
|
"version": "2.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz",
|
||||||
@@ -4443,6 +4415,23 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"strip-ansi": {
|
||||||
|
"version": "5.2.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz",
|
||||||
|
"integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"ansi-regex": "^4.1.0"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"ansi-regex": {
|
||||||
|
"version": "4.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz",
|
||||||
|
"integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==",
|
||||||
|
"dev": true
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -6362,20 +6351,12 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"strip-ansi": {
|
"strip-ansi": {
|
||||||
"version": "5.2.0",
|
"version": "4.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz",
|
||||||
"integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==",
|
"integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"ansi-regex": "^4.1.0"
|
"ansi-regex": "^3.0.0"
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"ansi-regex": {
|
|
||||||
"version": "4.1.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz",
|
|
||||||
"integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==",
|
|
||||||
"dev": true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"strip-eof": {
|
"strip-eof": {
|
||||||
@@ -6385,9 +6366,9 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"strip-json-comments": {
|
"strip-json-comments": {
|
||||||
"version": "3.0.1",
|
"version": "2.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz",
|
||||||
"integrity": "sha512-VTyMAUfdm047mwKl+u79WIdrZxtFtn+nBxHeb844XBQ9uMNTuTHdx2hc5RiAJYqwTj3wc/xe5HLSdJSkJ+WfZw==",
|
"integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"supports-color": {
|
"supports-color": {
|
||||||
@@ -6400,35 +6381,15 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"table": {
|
"table": {
|
||||||
"version": "5.4.6",
|
"version": "5.4.1",
|
||||||
"resolved": "https://registry.npmjs.org/table/-/table-5.4.6.tgz",
|
"resolved": "https://registry.npmjs.org/table/-/table-5.4.1.tgz",
|
||||||
"integrity": "sha512-wmEc8m4fjnob4gt5riFRtTu/6+4rSe12TpAELNSqHMfF3IqnA+CH37USM6/YR3qRZv7e56kAEAtd6nKZaxe0Ug==",
|
"integrity": "sha512-E6CK1/pZe2N75rGZQotFOdmzWQ1AILtgYbMAbAjvms0S1l5IDB47zG3nCnFGB/w+7nB3vKofbLXCH7HPBo864w==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"ajv": "^6.10.2",
|
"ajv": "^6.9.1",
|
||||||
"lodash": "^4.17.14",
|
"lodash": "^4.17.11",
|
||||||
"slice-ansi": "^2.1.0",
|
"slice-ansi": "^2.1.0",
|
||||||
"string-width": "^3.0.0"
|
"string-width": "^3.0.0"
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"ajv": {
|
|
||||||
"version": "6.10.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.2.tgz",
|
|
||||||
"integrity": "sha512-TXtUUEYHuaTEbLZWIKUr5pmBuhDLy+8KYtPYdcV8qC+pOZL+NKqYwvWSRrVXHn+ZmRRAu8vJTAznH7Oag6RVRw==",
|
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
|
||||||
"fast-deep-equal": "^2.0.1",
|
|
||||||
"fast-json-stable-stringify": "^2.0.0",
|
|
||||||
"json-schema-traverse": "^0.4.1",
|
|
||||||
"uri-js": "^4.2.2"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"lodash": {
|
|
||||||
"version": "4.17.15",
|
|
||||||
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz",
|
|
||||||
"integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==",
|
|
||||||
"dev": true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"tapable": {
|
"tapable": {
|
||||||
|
|||||||
@@ -36,8 +36,8 @@
|
|||||||
"babel-loader": "^8.0.6",
|
"babel-loader": "^8.0.6",
|
||||||
"babel-preset-minify": "^0.5.0",
|
"babel-preset-minify": "^0.5.0",
|
||||||
"core-js": "^3.1.4",
|
"core-js": "^3.1.4",
|
||||||
"eslint": "^6.2.2",
|
"eslint": "^6.0.1",
|
||||||
"webpack": "^4.35.3",
|
"webpack": "^4.35.3",
|
||||||
"webpack-cli": "^3.3.5"
|
"webpack-cli": "^3.3.5"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
4
wails-mewn.go
Normal file
4
wails-mewn.go
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
package wails
|
||||||
|
|
||||||
|
// Autogenerated by Mewn - Do not alter
|
||||||
|
|
||||||
Reference in New Issue
Block a user