summaryrefslogtreecommitdiff
path: root/install/root.go
diff options
context:
space:
mode:
authorEyal Posener <[email protected]>2017-05-06 22:21:03 +0300
committerGitHub <[email protected]>2017-05-06 22:21:03 +0300
commitc26ef096c7990a5ae97b503545fd76ff6df388d6 (patch)
treed0180b667269b985d15520f3b2e1aafc9292af6e /install/root.go
parent2b6aed2b1e974a733c0dc614a9617c33a54c208c (diff)
parent404634e843081e7010260bd95006b84d6c40a8fd (diff)
Merge pull request #4 from posener/doc
Doc
Diffstat (limited to 'install/root.go')
-rw-r--r--install/root.go29
1 files changed, 0 insertions, 29 deletions
diff --git a/install/root.go b/install/root.go
deleted file mode 100644
index 66e23b3..0000000
--- a/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
-}