mirror of
https://github.com/rancher/os.git
synced 2025-09-03 07:44:21 +00:00
Add docker Bash completion for other consoles
This commit is contained in:
@@ -16,9 +16,11 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
dockerConf = "/var/lib/rancher/conf/docker"
|
||||
dockerDone = "/run/docker-done"
|
||||
dockerLog = "/var/log/docker.log"
|
||||
dockerConf = "/var/lib/rancher/conf/docker"
|
||||
dockerDone = "/run/docker-done"
|
||||
dockerLog = "/var/log/docker.log"
|
||||
dockerCompletionLinkFile = "/usr/share/bash-completion/completions/docker"
|
||||
dockerCompletionFile = "/var/lib/rancher/engine/completion"
|
||||
)
|
||||
|
||||
func dockerInitAction(c *cli.Context) error {
|
||||
@@ -30,6 +32,12 @@ func dockerInitAction(c *cli.Context) error {
|
||||
time.Sleep(200 * time.Millisecond)
|
||||
}
|
||||
|
||||
if _, err := os.Stat(dockerCompletionFile); err != nil {
|
||||
if _, err := os.Readlink(dockerCompletionLinkFile); err == nil {
|
||||
syscall.Unlink(dockerCompletionLinkFile)
|
||||
}
|
||||
}
|
||||
|
||||
dockerBin := ""
|
||||
dockerPaths := []string{
|
||||
"/usr/bin",
|
||||
|
Reference in New Issue
Block a user