@@ -3,7 +3,7 @@ package cmd
33import (
44 "fmt"
55 "io/ioutil"
6- "path"
6+ "path/filepath "
77 "strconv"
88 "strings"
99
@@ -78,7 +78,7 @@ func KeyAdd(keyLocation string) error {
7878 return err
7979 }
8080
81- fmt .Printf ("Uploading %s to deis..." , path .Base (key .Name ))
81+ fmt .Printf ("Uploading %s to deis..." , filepath .Base (key .Name ))
8282
8383 if _ , err = keys .New (c , key .ID , key .Public ); err != nil {
8484 fmt .Println ()
@@ -99,7 +99,7 @@ func chooseKey() (api.KeyCreateRequest, error) {
9999 fmt .Println ("Found the following SSH public keys:" )
100100
101101 for i , key := range keys {
102- fmt .Printf ("%d) %s %s\n " , i + 1 , path .Base (key .Name ), key .ID )
102+ fmt .Printf ("%d) %s %s\n " , i + 1 , filepath .Base (key .Name ), key .ID )
103103 }
104104
105105 fmt .Println ("0) Enter path to pubfile (or use keys:add <key_path>)" )
@@ -132,7 +132,7 @@ func chooseKey() (api.KeyCreateRequest, error) {
132132}
133133
134134func listKeys () ([]api.KeyCreateRequest , error ) {
135- folder := path .Join (client .FindHome (), ".ssh" )
135+ folder := filepath .Join (client .FindHome (), ".ssh" )
136136 files , err := ioutil .ReadDir (folder )
137137
138138 if err != nil {
@@ -142,8 +142,8 @@ func listKeys() ([]api.KeyCreateRequest, error) {
142142 var keys []api.KeyCreateRequest
143143
144144 for _ , file := range files {
145- if path .Ext (file .Name ()) == ".pub" {
146- key , err := getKey (path .Join (folder , file .Name ()))
145+ if filepath .Ext (file .Name ()) == ".pub" {
146+ key , err := getKey (filepath .Join (folder , file .Name ()))
147147
148148 if err == nil {
149149 keys = append (keys , key )
@@ -163,7 +163,7 @@ func getKey(filename string) (api.KeyCreateRequest, error) {
163163 return api.KeyCreateRequest {}, err
164164 }
165165
166- backupID := strings .Split (path .Base (filename ), "." )[0 ]
166+ backupID := strings .Split (filepath .Base (filename ), "." )[0 ]
167167 keyInfo , err := ssh .ParsePubKey (backupID , keyContents )
168168 if err != nil {
169169 return api.KeyCreateRequest {}, fmt .Errorf ("%s is not a valid ssh key" , filename )
0 commit comments