diff --git a/src/main.go b/src/main.go index 9af936c1420dce4172bdaf2c25479f288cc3df4f..8023ec2dd0f6d3055ea253313e9912ec6288dffc 100644 --- a/src/main.go +++ b/src/main.go @@ -29,6 +29,7 @@ func main() { initTimeZone() // init ansible hosts initAnsibleHosts() + initTempDirPrefix() pflag.Parse() // init start args initConfig() // init log config @@ -129,3 +130,10 @@ func initAnsibleHosts() { } } } + +func initTempDirPrefix() { + err := os.Mkdir(conf.Options.TempDirPrefix, os.ModePerm) + if err != nil { + fmt.Println("创建目录失败!") + } +}