diff options
| author | Eyal Posener <[email protected]> | 2017-05-08 07:32:13 +0300 |
|---|---|---|
| committer | Eyal Posener <[email protected]> | 2017-05-08 07:32:13 +0300 |
| commit | 5db452a63f1b8ff0319f08986a4a04324647738f (patch) | |
| tree | adcd52253a99c5faf7817a6d2e415430f121d9c7 /cmd/install/root.go | |
| parent | b2791b736089134d6914c4d4362fbcdeadf1cdab (diff) | |
Install fixups
- remove root installation
- install according to shell type
Closes #7
Diffstat (limited to 'cmd/install/root.go')
| -rw-r--r-- | cmd/install/root.go | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/cmd/install/root.go b/cmd/install/root.go deleted file mode 100644 index 66e23b3..0000000 --- a/cmd/install/root.go +++ /dev/null @@ -1,29 +0,0 @@ -package install - -import "os" - -type root struct{} - -func (r root) Install(cmd string, bin string) error { - completeLink := getBashCompletionDLink(cmd) - err := r.Uninstall(cmd, bin) - if err != nil { - return err - } - return os.Symlink(bin, completeLink) -} - -func (root) Uninstall(cmd string, bin string) error { - completeLink := getBashCompletionDLink(cmd) - if _, err := os.Stat(completeLink); err == nil { - err := os.Remove(completeLink) - if err != nil { - return err - } - } - return nil -} - -func getBashCompletionDLink(cmd string) string { - return "/etc/bash_completion.d/" + cmd -} |
