Skip to content
This repository was archived by the owner on Jul 15, 2025. It is now read-only.

Commit c165984

Browse files
author
Philippe Lafoucrière
committed
Merge branch '0.2.9'
2 parents bff1183 + 5878f6a commit c165984

14 files changed

+53
-82
lines changed

.goxc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
"AppName": "gemnasium",
33
"BuildConstraints": "linux darwin windows",
44
"ConfigVersion": "0.9",
5-
"PackageVersion": "0.2.8"
5+
"PackageVersion": "0.2.9"
66
}

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
0.2.9 / 2016-07-09
2+
3+
* Fix debian packages
4+
* Code cleaning
5+
16
0.2.8 / 2016-07-07
27

38
* Add a Dockerfile, to build `gemnasium/toolbelt` image

commands/auth.go

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,7 @@ var login = func() error {
1212
// auth.Login wrapper with a cli.Content
1313
func Login(ctx *cli.Context) error {
1414
err := login()
15-
if err != nil {
16-
return cli.NewExitError(err.Error(), 1)
17-
}
18-
return nil
15+
return err
1916
}
2017

2118
var logout = func() error {
@@ -25,8 +22,5 @@ var logout = func() error {
2522
// auth.Logout wrapper with a cli.Content
2623
func Logout(ctx *cli.Context) error {
2724
err := logout()
28-
if err != nil {
29-
return cli.NewExitError(err.Error(), 1)
30-
}
31-
return nil
25+
return err
3226
}

commands/auto-update.go

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,24 +19,18 @@ func AutoUpdateRun(ctx *cli.Context) error {
1919
auth.AttemptLogin(ctx)
2020
project, err := models.GetProject(ctx.String("project"))
2121
if err != nil {
22-
return cli.NewExitError(err.Error(), 1)
22+
return err
2323
}
2424
err = auRunFunc(project.Slug, ctx.Args())
25-
if err != nil {
26-
return cli.NewExitError(err.Error(), 1)
27-
}
28-
return nil
25+
return err
2926
}
3027

3128
func AutoUpdateApply(ctx *cli.Context) error {
3229
auth.AttemptLogin(ctx)
3330
project, err := models.GetProject(ctx.String("project"))
3431
if err != nil {
35-
return cli.NewExitError(err.Error(), 1)
32+
return err
3633
}
3734
err = auApplyFunc(project.Slug, ctx.Args())
38-
if err != nil {
39-
return cli.NewExitError(err.Error(), 1)
40-
}
41-
return nil
35+
return err
4236
}

commands/configure.go

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,26 +10,20 @@ import (
1010
var confFunc = func(project *models.Project) error {
1111
f, err := os.Create(".gemnasium.yml")
1212
if err != nil {
13-
return cli.NewExitError(err.Error(), 1)
13+
return err
1414
}
1515
defer f.Close()
1616
err = project.Configure(project.Slug, os.Stdin, f)
17-
if err != nil {
18-
return cli.NewExitError(err.Error(), 1)
19-
}
20-
return nil
17+
return err
2118
}
2219

2320
func Configure(ctx *cli.Context) error {
2421
slug := ctx.Args().First()
2522
project, err := models.GetProject(slug)
2623
if err != nil {
27-
return cli.NewExitError(err.Error(), 1)
24+
return err
2825
}
2926

3027
err = confFunc(project)
31-
if err != nil {
32-
return cli.NewExitError(err.Error(), 1)
33-
}
34-
return nil
28+
return err
3529
}

commands/dependencies.go

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,8 @@ import (
88
func DependenciesList(ctx *cli.Context) error {
99
project, err := models.GetProject(ctx.Args().First())
1010
if err != nil {
11-
return cli.NewExitError(err.Error(), 1)
11+
return err
1212
}
1313
err = models.ListDependencies(project)
14-
if err != nil {
15-
return cli.NewExitError(err.Error(), 1)
16-
}
17-
return nil
14+
return err
1815
}

commands/dependency_alerts.go

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,9 @@ import (
88
func DependencyAlertsList(ctx *cli.Context) error {
99
project, err := models.GetProject(ctx.Args().First())
1010
if err != nil {
11-
return cli.NewExitError(err.Error(), 1)
11+
return err
1212
}
1313

1414
err = models.ListDependencyAlerts(project)
15-
if err != nil {
16-
return cli.NewExitError(err.Error(), 1)
17-
}
18-
return nil
15+
return err
1916
}

commands/dependency_files.go

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,28 +10,22 @@ import (
1010
func DependencyFilesList(ctx *cli.Context) error {
1111
project, err := models.GetProject()
1212
if err != nil {
13-
return cli.NewExitError(err.Error(), 1)
13+
return err
1414
}
1515
err = models.ListDependencyFiles(project)
16-
if err != nil {
17-
return cli.NewExitError(err.Error(), 1)
18-
}
19-
return nil
16+
return err
2017
}
2118

2219
func DependenciesPush(ctx *cli.Context) error {
2320
project, err := models.GetProject()
2421
if err != nil {
25-
return cli.NewExitError(err.Error(), 1)
22+
return err
2623
}
2724
var files []string
2825
if ctx.IsSet("files") {
2926
// Only call strings.Split on non-empty strings, otherwise len(strings) will be 1 instead of 0.
3027
files = strings.Split(ctx.String("files"), ",")
3128
}
3229
err = models.PushDependencyFiles(project.Slug, files)
33-
if err != nil {
34-
return cli.NewExitError(err.Error(), 1)
35-
}
36-
return nil
30+
return err
3731
}

commands/live_evaluation.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,5 @@ func LiveEvaluation(ctx *cli.Context) error {
1212
auth.AttemptLogin(ctx)
1313
files := strings.Split(ctx.String("files"), ",")
1414
err := liveeval.LiveEvaluation(files)
15-
if err != nil {
16-
return cli.NewExitError(err.Error(), 1)
17-
}
18-
return nil
15+
return err
1916
}

commands/projects.go

Lines changed: 8 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -9,29 +9,23 @@ import (
99

1010
func ProjectsList(ctx *cli.Context) error {
1111
err := models.ListProjects(ctx.Bool("private"))
12-
if err != nil {
13-
return cli.NewExitError(err.Error(), 1)
14-
}
15-
return nil
12+
return err
1613
}
1714

1815
func ProjectsShow(ctx *cli.Context) error {
1916
project, err := models.GetProject(ctx.Args().First())
2017
if err != nil {
21-
return cli.NewExitError(err.Error(), 1)
18+
return err
2219
}
2320

2421
err = project.Show()
25-
if err != nil {
26-
return cli.NewExitError(err.Error(), 1)
27-
}
28-
return nil
22+
return err
2923
}
3024

3125
func ProjectsUpdate(ctx *cli.Context) error {
3226
project, err := models.GetProject(ctx.Args().First())
3327
if err != nil {
34-
return cli.NewExitError(err.Error(), 1)
28+
return err
3529
}
3630
var name, desc *string
3731
var monitored *bool
@@ -48,31 +42,22 @@ func ProjectsUpdate(ctx *cli.Context) error {
4842
monitored = &mon
4943
}
5044
err = project.Update(name, desc, monitored)
51-
if err != nil {
52-
return cli.NewExitError(err.Error(), 1)
53-
}
54-
return nil
45+
return err
5546
}
5647

5748
func ProjectsCreate(ctx *cli.Context) error {
5849
projectName := ctx.Args().First()
5950
// will scan from os.Stding if projectName is empty
6051
err := models.CreateProject(projectName, os.Stdin)
61-
if err != nil {
62-
return cli.NewExitError(err.Error(), 1)
63-
}
64-
return nil
52+
return err
6553
}
6654

6755
func ProjectsSync(ctx *cli.Context) error {
6856
project, err := models.GetProject(ctx.Args().First())
6957
if err != nil {
70-
return cli.NewExitError(err.Error(), 1)
58+
return err
7159
}
7260

7361
err = project.Sync()
74-
if err != nil {
75-
return cli.NewExitError(err.Error(), 1)
76-
}
77-
return nil
62+
return err
7863
}

0 commit comments

Comments
 (0)