-
Notifications
You must be signed in to change notification settings - Fork 8
/
main.go
34 lines (28 loc) · 874 Bytes
/
main.go
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
package main
import (
"os"
"github.com/bitrise-io/go-steputils/v2/stepconf"
"github.com/bitrise-io/go-utils/v2/env"
"github.com/bitrise-io/go-utils/v2/exitcode"
"github.com/bitrise-io/go-utils/v2/log"
"github.com/bitrise-io/go-utils/v2/pathutil"
"github.com/bitrise-steplib/bitrise-step-save-gradle-cache/step"
)
func main() {
exitCode := run()
os.Exit(int(exitCode))
}
func run() exitcode.ExitCode {
logger := log.NewLogger()
envRepo := env.NewRepository()
inputParser := stepconf.NewInputParser(envRepo)
pathChecker := pathutil.NewPathChecker()
pathProvider := pathutil.NewPathProvider()
pathModifier := pathutil.NewPathModifier()
cacheStep := step.New(logger, inputParser, pathChecker, pathProvider, pathModifier, envRepo)
if err := cacheStep.Run(); err != nil {
logger.Errorf(err.Error())
return exitcode.Failure
}
return exitcode.Success
}