You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

54 lines
965 B

  1. package main
  2. import (
  3. "fmt"
  4. "runtime"
  5. "time"
  6. "github.com/gosuri/uiprogress"
  7. "github.com/manifoldco/promptui"
  8. "github.com/ttacon/chalk"
  9. )
  10. var logo = `
  11. __ __ _ _ _ _
  12. / / /\ \ (_) | _(_) (_)___
  13. \ \/ \/ / | |/ / | | / __|
  14. \ /\ /| | <| |_ | \__ \
  15. \/ \/ |_|_|\_\_(_)/ |___/
  16. |__/
  17. `
  18. func main() {
  19. fmt.Println(chalk.Yellow.Color(logo))
  20. fmt.Println(chalk.Bold.TextStyle("Installer for Wiki.js 2.x"))
  21. fmt.Printf("for %s-%s\n\n", runtime.GOOS, runtime.GOARCH)
  22. // Prompt for build to install
  23. prompt := promptui.Select{
  24. Label: "Select Build to install",
  25. Items: []string{"Stable", "Dev"},
  26. }
  27. _, result, err := prompt.Run()
  28. if err != nil {
  29. fmt.Printf("Prompt failed %v\n", err)
  30. return
  31. }
  32. fmt.Printf("You choose %q\n", result)
  33. // Download archives...
  34. uiprogress.Start()
  35. bar := uiprogress.AddBar(100)
  36. bar.AppendCompleted()
  37. bar.PrependElapsed()
  38. for bar.Incr() {
  39. time.Sleep(time.Millisecond * 20)
  40. }
  41. }