File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 77 "os"
88 "path/filepath"
99 "regexp"
10+ "runtime"
1011 "strings"
1112 "time"
1213
@@ -214,7 +215,7 @@ func createCAROOT() error {
214215 fmt .Printf ("creating new CA at %s\n " , path )
215216 }
216217
217- fmt . Printf ( " \n >> NOTE: you may be prompted to enter your sudo password << \n \n " )
218+ warnPW ( )
218219
219220 err := os .MkdirAll (path , 0755 )
220221 if err != nil {
@@ -235,6 +236,14 @@ func createCAROOT() error {
235236 return nil
236237}
237238
239+ func warnPW () {
240+ sudo := "sudo"
241+ if runtime .GOOS == "windows" {
242+ sudo = "admin"
243+ }
244+ fmt .Printf ("\n >> NOTE: you may be prompted to enter your %s password <<\n \n " , sudo )
245+ }
246+
238247func uninstallCAROOT () error {
239248 path := vproxy .CARootPath ()
240249 os .Setenv ("CAROOT" , path )
@@ -244,7 +253,7 @@ func uninstallCAROOT() error {
244253 return nil
245254 }
246255
247- fmt . Printf ( " \n >> NOTE: you may be prompted to enter your sudo password << \n \n " )
256+ warnPW ( )
248257
249258 truststore .Print = true
250259 err := vproxy .InitTrustStore ()
You can’t perform that action at this time.
0 commit comments