fix: change ControlPath to .vuls of SSH option (#618)

This commit is contained in:
Kota Kanbe
2018-03-14 16:39:17 +09:00
committed by GitHub
parent 9afbf1255f
commit 0c919da4b1
6 changed files with 55 additions and 2 deletions

View File

@@ -19,8 +19,11 @@ package commands
import (
"fmt"
"os"
"path/filepath"
"github.com/howeyc/gopass"
homedir "github.com/mitchellh/go-homedir"
)
func getPasswd(prompt string) (string, error) {
@@ -36,3 +39,17 @@ func getPasswd(prompt string) (string, error) {
}
}
func mkdirDotVuls() error {
home, err := homedir.Dir()
if err != nil {
return err
}
dotVuls := filepath.Join(home, ".vuls")
if _, err := os.Stat(dotVuls); os.IsNotExist(err) {
if err := os.Mkdir(dotVuls, 0700); err != nil {
return err
}
}
return nil
}