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

UiPath / uipathcli / 14386362407

10 Apr 2025 05:14PM UTC coverage: 90.504% (-0.001%) from 90.505%
14386362407

push

github

web-flow
Merge pull request #168 from UiPath/feature/clear-command

Add command to clear auth token cache

37 of 41 new or added lines in 2 files covered. (90.24%)

5985 of 6613 relevant lines covered (90.5%)

1.01 hits per line

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

75.0
/commandline/cache_clear_command_handler.go
1
package commandline
2

3
import (
4
        "fmt"
5
        "io"
6
        "os"
7

8
        "github.com/UiPath/uipathcli/utils/directories"
9
)
10

11
// cacheClearCommandHandler implements command to clear auth token cache
12
type cacheClearCommandHandler struct {
13
        StdOut io.Writer
14
}
15

16
func (h cacheClearCommandHandler) Clear() error {
1✔
17
        cacheDirectory, err := directories.Cache()
1✔
18
        if err != nil {
1✔
NEW
19
                return err
×
NEW
20
        }
×
21
        err = os.RemoveAll(cacheDirectory)
1✔
22
        if err != nil {
1✔
NEW
23
                return fmt.Errorf("Could not clear cache: %v", err)
×
NEW
24
        }
×
25
        fmt.Fprintln(h.StdOut, "Cache has been successfully cleared")
1✔
26
        return nil
1✔
27
}
28

29
func newCacheClearCommandHandler(stdOut io.Writer) *cacheClearCommandHandler {
1✔
30
        return &cacheClearCommandHandler{
1✔
31
                StdOut: stdOut,
1✔
32
        }
1✔
33
}
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