const path = require('path'); module.exports = { tags: async (tln) => [], dotenvs: async (tln) => [], env: async (tln, env) => { env.AWS_CLI_HOME = env.TLN_COMPONENT_HOME; env.PATH = [ path.join(env.TLN_COMPONENT_HOME, 'aws', 'dist'), path.join(env.TLN_COMPONENT_HOME, 'aws-cli'), env.PATH].join(path.delimiter); }, options: async (tln, args) => [], inherits: async (tln) => [], depends: async (tln) => [], 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 [aws-cli] && aws --version `]); } }}, { id: 'install', 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 && tln.canInstallComponent(tln, id, home)) { script.set(tln.getDownloadScript(tln, { linux: { name: `awscli-exe-linux-x86_64-${version}.zip`, opts: null, url: `https://awscli.amazonaws.com/awscli-exe-linux-x86_64-${version}.zip` }, darwin: { name: `AWSCLIV2-${version}.pkg`, opts: null, url: `https://awscli.amazonaws.com/AWSCLIV2-${version}.pkg`, cmd: ` envsubst < ${path.join(__dirname, 'choices.xml.template')} > choices.xml installer -pkg AWSCLIV2-${version}.pkg -target CurrentUserHomeDirectory -applyChoiceChangesXML choices.xml ` }, win32: { name: `AWSCLIV2-${version}.msi`, opts: null, url: `https://awscli.amazonaws.com/AWSCLIV2-${version}.msi`, cmd: ` msiexec.exe /i AWSCLIV2-${version}.msi ` } })); } } } ], components: async (tln) => require('./components.js') }