| 60 | } |
| 61 | |
| 62 | func checkFiles(cluster string) { |
| 63 | |
| 64 | var dataPath = helmpath.ConfigPath(cluster) |
| 65 | var repositoryPath = dataPath + "/repositories.yaml" |
| 66 | var registryPath = dataPath + "/registry.json" |
| 67 | |
| 68 | if _, err := os.Stat(dataPath); os.IsNotExist(err) { |
| 69 | os.MkdirAll(dataPath, 0777) |
| 70 | os.Chmod(dataPath, 0777) |
| 71 | } |
| 72 | if _, err := os.Stat(repositoryPath); os.IsNotExist(err) { |
| 73 | os.Create(repositoryPath) |
| 74 | } |
| 75 | if _, err := os.Stat(registryPath); os.IsNotExist(err) { |
| 76 | os.Create(registryPath) |
| 77 | } |
| 78 | return |
| 79 | } |
| 80 | |
| 81 | func NewClient(config *Config) (*Client, error) { |
| 82 | client := Client{ |