MCPcopy Create free account
hub / github.com/RisingStack/anchor / init

Function init

src/chart.js:11–35  ·  view source on GitHub ↗
({
  overwrite = false,
  outputPath = DEFAULT_OUTPUT_PATH,
  name = 'my-chart',
  description = '',
  version = '0.1.0'
})

Source from the content-addressed store, hash-verified

9const DEFAULT_OUTPUT_PATH = path.join(__dirname, '../output')
10
11function 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
37function saveTemplate (outputPath = DEFAULT_OUTPUT_PATH, chartResource) {
38 const fileName = `templates/${chartResource.resourceType}-${chartResource.resourceName}.yaml`

Callers

nothing calls this directly

Calls 1

saveToYAMLFileFunction · 0.85

Tested by

no test coverage detected