()
| 180 | } |
| 181 | |
| 182 | func (c *serverCmd) setRoot() error { |
| 183 | if c.root == "" { |
| 184 | if root, err := rootInTmpDir(); err != nil { |
| 185 | return err |
| 186 | } else { |
| 187 | c.root = filepath.Join(root, "port"+c.port) |
| 188 | } |
| 189 | } |
| 190 | log.Printf("Temp dir root is %v", c.root) |
| 191 | if c.wipe { |
| 192 | log.Printf("Wiping %v", c.root) |
| 193 | if err := os.RemoveAll(c.root); err != nil { |
| 194 | return fmt.Errorf("Could not wipe %v: %v", c.root, err) |
| 195 | } |
| 196 | } |
| 197 | return nil |
| 198 | } |
| 199 | |
| 200 | func (c *serverCmd) makeSuffixdir(fullpath string) { |
| 201 | if err := os.MkdirAll(fullpath, 0755); err != nil { |
no test coverage detected