-
-
Notifications
You must be signed in to change notification settings - Fork 369
Expand file tree
/
Copy pathdemo.go
More file actions
33 lines (26 loc) · 617 Bytes
/
demo.go
File metadata and controls
33 lines (26 loc) · 617 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package cmd
import (
"fmt"
"log"
"github.com/codegangsta/cli"
"github.com/exercism/cli/api"
"github.com/exercism/cli/config"
"github.com/exercism/cli/user"
)
// Demo returns one problem for each active track.
func Demo(ctx *cli.Context) {
c, err := config.Read(ctx.GlobalString("config"))
if err != nil {
log.Fatal(err)
}
problems, err := api.Demo(c)
if err != nil {
log.Fatal(err)
}
hw := user.NewHomework(problems, c)
if err := hw.Save(); err != nil {
log.Fatal(err)
}
hw.Report(user.HWAll)
fmt.Println("Next step: choose a language, read the README, and make the test suite pass.")
}