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

UiPath / uipathcli / 12392579821

18 Dec 2024 12:05PM UTC coverage: 88.981% (+2.9%) from 86.121%
12392579821

push

github

thschmitt
Add support to analyze studio projects

211 of 270 new or added lines in 8 files covered. (78.15%)

40 existing lines in 4 files now uncovered.

4813 of 5409 relevant lines covered (88.98%)

1.0 hits per line

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

77.78
/plugin/studio/uipcli.go
1
package studio
2

3
import (
4
        "fmt"
5
        "os/exec"
6
        "path/filepath"
7
        "runtime"
8

9
        "github.com/UiPath/uipathcli/log"
10
        "github.com/UiPath/uipathcli/plugin"
11
        "github.com/UiPath/uipathcli/utils"
12
)
13

14
const uipcliVersion = "24.12.9111.31003"
15
const uipcliUrl = "https://uipath.pkgs.visualstudio.com/Public.Feeds/_apis/packaging/feeds/1c781268-d43d-45ab-9dfc-0151a1c740b7/nuget/packages/UiPath.CLI/versions/" + uipcliVersion + "/content"
16

17
type uipcli struct {
18
        Exec   utils.ExecProcess
19
        Logger log.Logger
20
}
21

22
func (c uipcli) Execute(args ...string) (utils.ExecCmd, error) {
1✔
23
        uipcliPath, err := c.getPath()
1✔
24
        if err != nil {
1✔
NEW
25
                return nil, err
×
NEW
26
        }
×
27

28
        path := uipcliPath
1✔
29
        if filepath.Ext(uipcliPath) == ".dll" {
2✔
30
                path, err = exec.LookPath("dotnet")
1✔
31
                if err != nil {
1✔
NEW
32
                        return nil, fmt.Errorf("Could not find dotnet runtime to run command: %v", err)
×
NEW
33
                }
×
34
                args = append([]string{uipcliPath}, args...)
1✔
35
        }
36

37
        cmd := c.Exec.Command(path, args...)
1✔
38
        return cmd, nil
1✔
39
}
40

41
func (c uipcli) getPath() (string, error) {
1✔
42
        externalPlugin := plugin.NewExternalPlugin(c.Logger)
1✔
43
        executable := "tools/uipcli.dll"
1✔
44
        if c.isWindows() {
1✔
NEW
45
                executable = "tools/uipcli.exe"
×
NEW
46
        }
×
47
        return externalPlugin.GetTool("uipcli", uipcliUrl, executable)
1✔
48
}
49

50
func (c uipcli) isWindows() bool {
1✔
51
        return runtime.GOOS == "windows"
1✔
52
}
1✔
53

54
func newUipcli(exec utils.ExecProcess, logger log.Logger) *uipcli {
1✔
55
        return &uipcli{exec, logger}
1✔
56
}
1✔
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