({
overwrite = false,
outputPath = DEFAULT_OUTPUT_PATH,
name = 'my-chart',
description = '',
version = '0.1.0'
})
| 9 | const DEFAULT_OUTPUT_PATH = path.join(__dirname, '../output') |
| 10 | |
| 11 | function init ({ |
| 12 | overwrite = false, |
| 13 | outputPath = DEFAULT_OUTPUT_PATH, |
| 14 | name = 'my-chart', |
| 15 | description = '', |
| 16 | version = '0.1.0' |
| 17 | }) { |
| 18 | const outputTemplatePath = path.join(outputPath, 'templates') |
| 19 | const filePath = path.join(outputPath, 'Chart.yaml') |
| 20 | const chart = { |
| 21 | apiVersion: 'v1', |
| 22 | description, |
| 23 | name, |
| 24 | version |
| 25 | } |
| 26 | |
| 27 | // Recreate folder |
| 28 | if (overwrite) { |
| 29 | rimraf.sync(outputPath) |
| 30 | mkdirp.sync(outputPath) |
| 31 | } |
| 32 | mkdirp.sync(outputTemplatePath) |
| 33 | |
| 34 | return saveToYAMLFile(filePath, chart) |
| 35 | } |
| 36 | |
| 37 | function saveTemplate (outputPath = DEFAULT_OUTPUT_PATH, chartResource) { |
| 38 | const fileName = `templates/${chartResource.resourceType}-${chartResource.resourceName}.yaml` |
nothing calls this directly
no test coverage detected