const path = require('path'); const os = require('os'); module.exports = { tags: async (tln) => [], options: async (tln) => [], dotenvs: async (tln) => [], inherits: async (tln) => [], depends: async (tln) => [], env: async (tln, env) => { env.HELM_HOME = env.TLN_COMPONENT_HOME; env.PATH = [env.TLN_COMPONENT_HOME, env.PATH].join(path.delimiter); }, steps: async (tln) => [ { id: 'version', builder: async (tln, script) => { const id = script.env.TLN_COMPONENT_ID; const home = script.env.TLN_COMPONENT_HOME; const {name, version} = tln.unpackId(id); if (version) { script.set([` echo [helm] && helm version `]); } }}, { id: 'install', builder: (tln, script) => { const id = script.env.TLN_COMPONENT_ID; const home = script.env.TLN_COMPONENT_HOME; const {name, version} = tln.unpackId(id); if (version && tln.canInstallComponent(tln, id, home)) { const arch = os.arch() === 'x64' ? 'amd64' : os.arch(); script.set(tln.getDownloadScript(tln, { linux: { name: `helm-v${version}-linux-${arch}.tar.gz`, opts: { src: `linux-${arch}`, flt:`*`, dest:`.`, rmv: `linux-${arch}` }, url: `https://get.helm.sh/helm-v${version}-linux-${arch}.tar.gz` }, darwin: { name: `helm-v${version}-darwin-${arch}.tar.gz`, opts: { src: `darwin-${arch}`, flt:`*`, dest:`.`, rmv: `darwin-${arch}` }, url: `https://get.helm.sh/helm-v${version}-darwin-${arch}.tar.gz` }, win32: { name: `helm-v${version}-windows-${arch}.zip`, opts: { src: `windows-${arch}`, flt:`*`, dest:`.`, rmv: `windows-${arch}` }, url: `https://get.helm.sh/helm-v${version}-windows-${arch}.zip` } })); } } } ], components: async (tln) => require('./components.js') }