5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-02 12:49:29 +08:00

feat: make setup the default command

docs: better help text
This commit is contained in:
Lea Anthony 2018-12-23 17:33:44 +11:00
parent 76a4c3c171
commit 35d4c4b99c
2 changed files with 10 additions and 3 deletions

View File

@ -132,6 +132,11 @@ func (s *SystemHelper) setup() error {
return answers.Save(s.wailsSystemConfig)
}
const introText = `
Wails is a lightweight framework for creating web-like desktop apps in Go.
I'll need to ask you a few questions so I can fill in your project templates and then I will try and see if you have the correct dependencies installed. If you don't have the right tools installed, I'll try and suggest how to install them.
`
// Initialise attempts to set up the Wails system.
// An error is returns if there is a problem
func (s *SystemHelper) Initialise() error {
@ -139,7 +144,7 @@ func (s *SystemHelper) Initialise() error {
// System dir doesn't exist
if !s.systemDirExists() {
s.log.Green("Welcome to Wails!")
s.log.Green("To get you set up, I'll need to ask you a few things...")
s.log.Green(introText)
return s.setup()
}

View File

@ -12,10 +12,12 @@ func init() {
commandDescription := `Sets up your local environment to develop Wails apps.`
initCommand := app.Command("setup", "Setup the Wails environment").
setupCommand := app.Command("setup", "Setup the Wails environment").
LongDescription(commandDescription)
initCommand.Action(func() error {
app.DefaultCommand(setupCommand)
setupCommand.Action(func() error {
system := cmd.NewSystemHelper()
err := system.Initialise()