• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

UiPath / uipathcli / 12390549287

18 Dec 2024 09:56AM UTC coverage: 86.121% (+0.05%) from 86.074%
12390549287

push

github

thschmitt
Add support to analyze studio projects

56 of 272 new or added lines in 8 files covered. (20.59%)

70 existing lines in 4 files now uncovered.

4660 of 5411 relevant lines covered (86.12%)

0.97 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

90.38
/main.go
1
// Package main contains the entry point of the uipath command line interface.
2
//
3
// It only initializes the different packages and delegates the actual work.
4
package main
5

6
import (
7
        "embed"
8
        "fmt"
9
        "os"
10
        "runtime"
11

12
        "github.com/UiPath/uipathcli/auth"
13
        "github.com/UiPath/uipathcli/cache"
14
        "github.com/UiPath/uipathcli/commandline"
15
        "github.com/UiPath/uipathcli/config"
16
        "github.com/UiPath/uipathcli/executor"
17
        "github.com/UiPath/uipathcli/parser"
18
        "github.com/UiPath/uipathcli/plugin"
19
        plugin_digitizer "github.com/UiPath/uipathcli/plugin/digitizer"
20
        plugin_orchestrator "github.com/UiPath/uipathcli/plugin/orchestrator"
21
        plugin_studio "github.com/UiPath/uipathcli/plugin/studio"
22
        "github.com/UiPath/uipathcli/utils"
23
)
24

25
//go:embed definitions/*.yaml
26
var embedded embed.FS
27

28
func authenticators() []auth.Authenticator {
1✔
29
        return []auth.Authenticator{
1✔
30
                auth.NewPatAuthenticator(),
1✔
31
                auth.NewOAuthAuthenticator(cache.NewFileCache(), auth.NewExecBrowserLauncher()),
1✔
32
                auth.NewBearerAuthenticator(cache.NewFileCache()),
1✔
33
        }
1✔
34
}
1✔
35

36
func colorsSupported() bool {
1✔
37
        _, noColorSet := os.LookupEnv("NO_COLOR")
1✔
38
        term, _ := os.LookupEnv("TERM")
1✔
39
        omitColors := noColorSet || term == "dumb" || runtime.GOOS == "windows"
1✔
40
        return !omitColors
1✔
41
}
1✔
42

43
func stdIn() utils.Stream {
1✔
44
        return utils.NewReaderStream(parser.RawBodyParameterName, os.Stdin)
1✔
45
}
1✔
46

47
func main() {
1✔
48
        configProvider := config.NewConfigProvider(
1✔
49
                config.NewConfigFileStore(os.Getenv("UIPATH_CONFIGURATION_PATH")),
1✔
50
        )
1✔
51
        err := configProvider.Load()
1✔
52
        if err != nil {
1✔
53
                fmt.Fprintln(os.Stderr, err.Error())
×
54
                os.Exit(131)
×
55
        }
×
56

57
        authenticators := authenticators()
1✔
58
        cli := commandline.NewCli(
1✔
59
                os.Stdin,
1✔
60
                os.Stdout,
1✔
61
                os.Stderr,
1✔
62
                colorsSupported(),
1✔
63
                *commandline.NewDefinitionProvider(
1✔
64
                        commandline.NewDefinitionFileStore(os.Getenv("UIPATH_DEFINITIONS_PATH"), embedded),
1✔
65
                        parser.NewOpenApiParser(),
1✔
66
                        []plugin.CommandPlugin{
1✔
67
                                plugin_digitizer.NewDigitizeCommand(),
1✔
68
                                plugin_orchestrator.NewUploadCommand(),
1✔
69
                                plugin_orchestrator.NewDownloadCommand(),
1✔
70
                                plugin_studio.NewPackagePackCommand(),
1✔
71
                                plugin_studio.NewPackageAnalyzeCommand(),
1✔
72
                        },
1✔
73
                ),
1✔
74
                *configProvider,
1✔
75
                executor.NewHttpExecutor(authenticators),
1✔
76
                executor.NewPluginExecutor(authenticators),
1✔
77
        )
1✔
78

1✔
79
        input := stdIn()
1✔
80
        err = cli.Run(os.Args, input)
1✔
81
        if err != nil {
1✔
UNCOV
82
                os.Exit(1)
×
83
        }
×
84
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc