(io *iostreams.IOStreams, total int)
| 1098 | const installProgressLabel = "Downloading skill files" |
| 1099 | |
| 1100 | func installProgress(io *iostreams.IOStreams, total int) func(done, total int) { |
| 1101 | if total <= 0 { |
| 1102 | return nil |
| 1103 | } |
| 1104 | return func(done, total int) { |
| 1105 | if done == 0 { |
| 1106 | io.StartProgressIndicatorWithLabel(installProgressLabel) |
| 1107 | } else if done >= total { |
| 1108 | io.StopProgressIndicator() |
| 1109 | } |
| 1110 | } |
| 1111 | } |
| 1112 | |
| 1113 | func friendlyDir(dir string) string { |
| 1114 | if cwd, err := os.Getwd(); err == nil { |