mirror of
https://github.com/taigrr/wails.git
synced 2026-04-14 19:01:09 -07:00
Compare commits
11 Commits
91-create-
...
v0.14.7-pr
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
249720b0cc | ||
|
|
3553cb6694 | ||
|
|
3c0fa4c55e | ||
|
|
c07a4b6c16 | ||
|
|
8175eb4446 | ||
|
|
eeab418c90 | ||
|
|
0eb59d823e | ||
|
|
f07705268d | ||
|
|
63fef39854 | ||
|
|
3ea45da2c8 | ||
|
|
eb0d9f3ba4 |
@@ -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))
|
||||||
|
|||||||
@@ -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.7-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
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
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