MCPcopy Create free account
hub / github.com/SpectoLabs/hoverfly / determineSymlinkLocation

Function determineSymlinkLocation

hoverctl/cmd/bash_completion.go:50–64  ·  view source on GitHub ↗
(args []string)

Source from the content-addressed store, hash-verified

48}
49
50func determineSymlinkLocation(args []string) (string, error) {
51 var symlinkToCompletionFile string
52 var err error
53
54 //optionally override the symlink location from command line
55 if len(args) > 0 {
56 symlinkToCompletionFile, err = expandHomeDirectory(args[0])
57 if err != nil {
58 return "", err
59 }
60 } else {
61 symlinkToCompletionFile = locateProbableCompletionFileLocation()
62 }
63 return symlinkToCompletionFile, nil
64}
65
66func createSymlink(completionFilePath string, symlinkToCompletionFile string) error {
67 err := os.Symlink(completionFilePath, symlinkToCompletionFile)

Callers 1

bash_completion.goFile · 0.85

Calls 2

expandHomeDirectoryFunction · 0.85

Tested by

no test coverage detected