mirror of
https://github.com/taigrr/wails.git
synced 2026-04-14 10:50:53 -07:00
Compare commits
12 Commits
v0.14.6-pr
...
98-use-sna
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
06a1372e80 | ||
|
|
7a16cf74f0 | ||
|
|
4239c89b76 | ||
|
|
29ea5cc74d | ||
|
|
9be56c47e4 | ||
|
|
249720b0cc | ||
|
|
3553cb6694 | ||
|
|
3c0fa4c55e | ||
|
|
c07a4b6c16 | ||
|
|
0eb59d823e | ||
|
|
f07705268d | ||
|
|
63fef39854 |
@@ -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.6-pre"
|
const Version = "develop"
|
||||||
|
|||||||
@@ -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.")
|
||||||
|
|||||||
Reference in New Issue
Block a user