1 import * as common from './common'; 2 import * as process from 'process'; 3 4 const errorContextMessage = 'Download Error'; 5 6 (async () => { 7 try { 8 const config = common.getCurrentConfiguration(); 9 const executable = config.getLocalLocation(); 10 11 if (process.argv.includes('exec')) { 12 const filenameShasum = config.getShasumFile(); 13 const downloadUrl = config.getDownloadLocation(); 14 15 const downloadError = await common.downloadExecutable( 16 downloadUrl, 17 executable, 18 filenameShasum, 19 ); 20 if (downloadError !== undefined) { 21 throw downloadError; 22 } 23 } 24 } catch (err) { 25 await common.logError(errorContextMessage, err); 26 } 27 })();