@ -104,14 +104,15 @@ func (r *ChartRepository) DownloadIndexFile() (string, error) {
}
}
// Create the chart list file in the cache directory
// Create the chart list file in the cache directory
var charts strings. Build er
var charts bytes. Buff er
for name := range indexFile . Entries {
for name := range indexFile . Entries {
fmt . Fprintln ( & charts , name )
charts . WriteString ( name )
charts . WriteByte ( '\n' ) // Terminate each entry with a newline
}
}
chartsFile := filepath . Join ( r . CachePath , helmpath . CacheChartsFile ( r . Config . Name ) )
chartsFile := filepath . Join ( r . CachePath , helmpath . CacheChartsFile ( r . Config . Name ) )
os . MkdirAll ( filepath . Dir ( chartsFile ) , 0 o755 )
os . MkdirAll ( filepath . Dir ( chartsFile ) , 0 o755 )
fileutil . AtomicWriteFile ( chartsFile , bytes . NewReader ( [ ] byte ( charts . String ( ) ) ) , 0 o644 )
fileutil . AtomicWriteFile ( chartsFile , & charts , 0 o644 )
// Create the index file in the cache directory
// Create the index file in the cache directory
fname := filepath . Join ( r . CachePath , helmpath . CacheIndexFile ( r . Config . Name ) )
fname := filepath . Join ( r . CachePath , helmpath . CacheIndexFile ( r . Config . Name ) )