const path = require('path'); module.exports = { tags: async (tln) => [], options: async (tln, args) => { args .prefix('TLN_FIREBASE') ; }, env: async (tln, env) => { env.GCLOUD_HOME = env.TLN_COMPONENT_HOME; env.PATH = [env.TLN_COMPONENT_HOME, env.PATH].join(path.delimiter); }, dotenvs: async (tln) => [], 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 [firebase] && firebase --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: `firebase-tools-linux`, opts: null, url: `https://github.com/firebase/firebase-tools/releases/download/v${version}/firebase-tools-linux`, cmd: 'mv firebase-tools-linux firebase && chmod +x ./firebase', keep: true }, darwin: { name: `firebase-tools-macos`, opts: null, url: `https://github.com/firebase/firebase-tools/releases/download/v${version}/firebase-tools-macos`, cmd: 'mv firebase-tools-macos firebase && chmod +x ./firebase', keep: true }, win32: { name: `firebase.exe`, opts: { src: `google-cloud-sdk`, flt:`*`, dest:`.`, rmv: `google-cloud-sdk` }, url: `https://github.com/firebase/firebase-tools/releases/download/v${version}/firebase-tools-win.exe`, cmd: null, keep: true } })); } } } ], components: async (tln) => require('./components.js') }