"Fossies" - the Fresh Open Source Software Archive

Member "cli-1.1227.0/ts-binary-wrapper/src/bootstrap.ts" (25 Sep 2023, 698 Bytes) of package /linux/misc/snyk-cli-1.1227.0.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) TypeScript source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    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 })();