mirror of
https://github.com/taigrr/wails.git
synced 2026-04-14 02:48:21 -07:00
Compare commits
18 Commits
91-create-
...
v0.14.8-pr
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a5aeafc4bc | ||
|
|
9a5833f7c9 | ||
|
|
06a1372e80 | ||
|
|
7a16cf74f0 | ||
|
|
4239c89b76 | ||
|
|
29ea5cc74d | ||
|
|
9be56c47e4 | ||
|
|
249720b0cc | ||
|
|
3553cb6694 | ||
|
|
3c0fa4c55e | ||
|
|
c07a4b6c16 | ||
|
|
8175eb4446 | ||
|
|
eeab418c90 | ||
|
|
0eb59d823e | ||
|
|
f07705268d | ||
|
|
63fef39854 | ||
|
|
3ea45da2c8 | ||
|
|
eb0d9f3ba4 |
@@ -33,7 +33,7 @@ Wails is currently in Beta. Please make sure you read the [Project Status](https
|
|||||||
|
|
||||||
Wails uses cgo to bind to the native rendering engines so a number of platform dependent libraries are needed as well as an installation of Go. The basic requirements are:
|
Wails uses cgo to bind to the native rendering engines so a number of platform dependent libraries are needed as well as an installation of Go. The basic requirements are:
|
||||||
|
|
||||||
- Go 1.11 or above
|
- Go 1.12
|
||||||
- npm
|
- npm
|
||||||
|
|
||||||
### MacOS
|
### MacOS
|
||||||
|
|||||||
@@ -110,16 +110,19 @@ func (fs *FSHelper) RemoveFiles(files []string) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Dir holds information about a directory
|
||||||
type Dir struct {
|
type Dir struct {
|
||||||
localPath string
|
localPath string
|
||||||
fullPath string
|
fullPath string
|
||||||
}
|
}
|
||||||
|
|
||||||
func (fs *FSHelper) Dir(dir string) (*Dir, error) {
|
// Directory creates a new Dir struct with the given directory path
|
||||||
|
func (fs *FSHelper) Directory(dir string) (*Dir, error) {
|
||||||
fullPath, err := filepath.Abs(dir)
|
fullPath, err := filepath.Abs(dir)
|
||||||
return &Dir{fullPath: fullPath}, err
|
return &Dir{fullPath: fullPath}, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// LocalDir creates a new Dir struct based on a path relative to the caller
|
||||||
func (fs *FSHelper) LocalDir(dir string) (*Dir, error) {
|
func (fs *FSHelper) LocalDir(dir string) (*Dir, error) {
|
||||||
_, filename, _, _ := runtime.Caller(1)
|
_, filename, _, _ := runtime.Caller(1)
|
||||||
fullPath, err := filepath.Abs(filepath.Join(path.Dir(filename), dir))
|
fullPath, err := filepath.Abs(filepath.Join(path.Dir(filename), dir))
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ func getRequiredProgramsLinux() *Prerequisites {
|
|||||||
case Ubuntu:
|
case Ubuntu:
|
||||||
result.Add(newPrerequisite("gcc", "Please install with `sudo apt install build-essentials` and try again"))
|
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("pkg-config", "Please install with `sudo apt install pkg-config` and try again"))
|
||||||
result.Add(newPrerequisite("npm", "Please install with `sudo apt install npm` and try again"))
|
result.Add(newPrerequisite("npm", "Please install with `sudo snap install node --channel=12/stable --classic` and try again"))
|
||||||
|
|
||||||
default:
|
default:
|
||||||
result.Add(newPrerequisite("gcc", "Please install with your system package manager and try again"))
|
result.Add(newPrerequisite("gcc", "Please install with your system package manager and try again"))
|
||||||
|
|||||||
@@ -84,8 +84,6 @@ func (ph *ProjectHelper) GenerateProject(projectOptions *ProjectOptions) error {
|
|||||||
// ph.GenerateWindowsResourceConfig(projectOptions)
|
// ph.GenerateWindowsResourceConfig(projectOptions)
|
||||||
// }
|
// }
|
||||||
|
|
||||||
ph.log.Yellow("Project '%s' generated in directory '%s'!", projectOptions.Name, projectOptions.OutputDirectory)
|
|
||||||
ph.log.Yellow("To compile the project, run 'wails build' in the project directory.")
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -141,7 +141,7 @@ func (t *TemplateHelper) GetTemplateDetails() (map[string]*TemplateDetails, erro
|
|||||||
func (t *TemplateHelper) GetTemplateFilenames(template *TemplateDetails) (*slicer.StringSlicer, error) {
|
func (t *TemplateHelper) GetTemplateFilenames(template *TemplateDetails) (*slicer.StringSlicer, error) {
|
||||||
|
|
||||||
// Get the subdirectory details
|
// Get the subdirectory details
|
||||||
templateDir, err := t.fs.Dir(template.Path)
|
templateDir, err := t.fs.Directory(template.Path)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
package cmd
|
package cmd
|
||||||
|
|
||||||
// Version - Wails version
|
// Version - Wails version
|
||||||
const Version = "v0.14.4-pre"
|
const Version = "v0.14.8-pre"
|
||||||
|
|||||||
@@ -2,7 +2,10 @@ package main
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"os"
|
||||||
|
"path/filepath"
|
||||||
|
|
||||||
|
"github.com/leaanthony/spinner"
|
||||||
"github.com/wailsapp/wails/cmd"
|
"github.com/wailsapp/wails/cmd"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -50,11 +53,33 @@ Any flags that are required and not given will be prompted for.`
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
genSpinner := spinner.NewSpinner()
|
||||||
|
genSpinner.SetSpinSpeed(50)
|
||||||
|
genSpinner.Start("Generating project...")
|
||||||
|
|
||||||
// Generate the project
|
// Generate the project
|
||||||
err = projectHelper.GenerateProject(projectOptions)
|
err = projectHelper.GenerateProject(projectOptions)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Error(err.Error())
|
genSpinner.Error()
|
||||||
|
return err
|
||||||
}
|
}
|
||||||
|
genSpinner.Success()
|
||||||
|
|
||||||
|
// Build the project
|
||||||
|
cwd, _ := os.Getwd()
|
||||||
|
projectDir := filepath.Join(cwd, projectOptions.OutputDirectory)
|
||||||
|
program := cmd.NewProgramHelper()
|
||||||
|
buildSpinner := spinner.NewSpinner()
|
||||||
|
buildSpinner.SetSpinSpeed(50)
|
||||||
|
buildSpinner.Start("Building project (this may take a while)...")
|
||||||
|
err = program.RunCommandArray([]string{"wails", "build"}, projectDir)
|
||||||
|
if err != nil {
|
||||||
|
buildSpinner.Error(err.Error())
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
buildSpinner.Success()
|
||||||
|
logger.Yellow("Project '%s' built in directory '%s'!", projectOptions.Name, projectOptions.OutputDirectory)
|
||||||
|
|
||||||
return err
|
return err
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ To help you in this process, we will ask for some information, add Go/Wails deta
|
|||||||
body = "**Description**\n" + (strings.Split(body, "**Description**")[1])
|
body = "**Description**\n" + (strings.Split(body, "**Description**")[1])
|
||||||
fullURL := "https://github.com/wailsapp/wails/issues/new?"
|
fullURL := "https://github.com/wailsapp/wails/issues/new?"
|
||||||
body = strings.Replace(body, "A clear and concise description of what the bug is.", description, -1)
|
body = strings.Replace(body, "A clear and concise description of what the bug is.", description, -1)
|
||||||
body = strings.Replace(body, "Please paste the output of `wails report` here.", str.String(), -1)
|
body = strings.Replace(body, "Please provide your platform, GO version and variables, etc", str.String(), -1)
|
||||||
params := "title=" + title + "&body=" + body
|
params := "title=" + title + "&body=" + body
|
||||||
|
|
||||||
fmt.Println("Opening browser to file issue.")
|
fmt.Println("Opening browser to file issue.")
|
||||||
|
|||||||
2
go.mod
2
go.mod
@@ -11,7 +11,7 @@ require (
|
|||||||
github.com/jackmordaunt/icns v1.0.0
|
github.com/jackmordaunt/icns v1.0.0
|
||||||
github.com/kennygrant/sanitize v1.2.4
|
github.com/kennygrant/sanitize v1.2.4
|
||||||
github.com/konsorten/go-windows-terminal-sequences v1.0.2 // indirect
|
github.com/konsorten/go-windows-terminal-sequences v1.0.2 // indirect
|
||||||
github.com/leaanthony/mewn v0.10.6
|
github.com/leaanthony/mewn v0.10.7
|
||||||
github.com/leaanthony/slicer v1.3.1
|
github.com/leaanthony/slicer v1.3.1
|
||||||
github.com/leaanthony/spinner v0.5.0
|
github.com/leaanthony/spinner v0.5.0
|
||||||
github.com/masterminds/semver v1.4.2
|
github.com/masterminds/semver v1.4.2
|
||||||
|
|||||||
4
go.sum
4
go.sum
@@ -33,8 +33,8 @@ github.com/konsorten/go-windows-terminal-sequences v1.0.2 h1:DB17ag19krx9CFsz4o3
|
|||||||
github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
|
github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
|
||||||
github.com/kr/pty v1.1.1 h1:VkoXIwSboBpnk99O/KFauAEILuNHv5DVFKZMBN/gUgw=
|
github.com/kr/pty v1.1.1 h1:VkoXIwSboBpnk99O/KFauAEILuNHv5DVFKZMBN/gUgw=
|
||||||
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
||||||
github.com/leaanthony/mewn v0.10.6 h1:tL8YYcVXGpJJeWlwjd2su88or8Ul+0cQoJPNcICGMto=
|
github.com/leaanthony/mewn v0.10.7 h1:jCcNJyIUOpwj+I5SuATvCugDjHkoo+j6ubEOxxrxmPA=
|
||||||
github.com/leaanthony/mewn v0.10.6/go.mod h1:i3ygCWW96qVQlGa8sjWnTM0IKAijoFvTwATDIZgK4k0=
|
github.com/leaanthony/mewn v0.10.7/go.mod h1:CRkTx8unLiSSilu/Sd7i1LwrdaAL+3eQ3ses99qGMEQ=
|
||||||
github.com/leaanthony/slicer v1.3.1 h1:n2iIV2sxvL/3bpnmVY0vBjXf3yYFWcB6CYLVMrzJxRw=
|
github.com/leaanthony/slicer v1.3.1 h1:n2iIV2sxvL/3bpnmVY0vBjXf3yYFWcB6CYLVMrzJxRw=
|
||||||
github.com/leaanthony/slicer v1.3.1/go.mod h1:VMB/HGvr3uR3MRpFWHWAm0w+DHQLzPHYe2pKfpFlQIQ=
|
github.com/leaanthony/slicer v1.3.1/go.mod h1:VMB/HGvr3uR3MRpFWHWAm0w+DHQLzPHYe2pKfpFlQIQ=
|
||||||
github.com/leaanthony/spinner v0.5.0 h1:HQykt/iTy7fmINEREtRbWrt+8j4MxC8dtvWBxEWM9oA=
|
github.com/leaanthony/spinner v0.5.0 h1:HQykt/iTy7fmINEREtRbWrt+8j4MxC8dtvWBxEWM9oA=
|
||||||
|
|||||||
Reference in New Issue
Block a user