-
-
Notifications
You must be signed in to change notification settings - Fork 369
Expand file tree
/
Copy pathlogout.go
More file actions
37 lines (27 loc) · 722 Bytes
/
logout.go
File metadata and controls
37 lines (27 loc) · 722 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
34
35
36
37
package cmd
import (
"fmt"
"log"
"os"
"github.com/codegangsta/cli"
"github.com/exercism/cli/config"
)
// Logout deletes the config file.
// Delete when nobody is using 1.6.x anymore.
func Logout(ctx *cli.Context) {
msg := `
*******************************************************************
DEPRECATED!
In the future use the 'exercism configure' command to reconfigure:
exercism configure --key YOUR_API_KEY
Or delete the config file yourself.
*******************************************************************
`
fmt.Printf(msg)
file, err := config.FilePath(ctx.GlobalString("config"))
if err != nil {
log.Fatal(err)
}
fmt.Printf("Deleting config file at %s\n\n", file)
os.Remove(file)
}