import execa from 'execa'; let cmd: InstallCommand; export type InstallCommand = 'yarn' | 'npm'; export default async function getInstallCmd(): Promise { if (cmd) { return cmd; } try { await execa('yarnpkg', ['--version']); cmd = 'yarn'; } catch (e) { cmd = 'npm'; } return cmd; }