"Fossies" - the Fresh Open Source Software Archive

Member "angular-cli-15.2.4/tests/legacy-cli/e2e/setup/001-create-tmp-dir.ts" (16 Mar 2023, 607 Bytes) of package /linux/www/angular-cli-15.2.4.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. See also the last Fossies "Diffs" side-by-side code changes report for "001-create-tmp-dir.ts": 15.1.6_vs_15.2.0.

    1 import { dirname } from 'path';
    2 import { getGlobalVariable, setGlobalVariable } from '../utils/env';
    3 import { mktempd } from '../utils/utils';
    4 
    5 export default async function () {
    6   const argv = getGlobalVariable('argv');
    7 
    8   // Get to a temporary directory.
    9   let tempRoot: string;
   10   if (argv.reuse) {
   11     tempRoot = dirname(argv.reuse);
   12   } else if (argv.tmpdir) {
   13     tempRoot = argv.tmpdir;
   14   } else {
   15     tempRoot = await mktempd('angular-cli-e2e-', process.env.E2E_TEMP);
   16   }
   17   console.log(`  Using "${tempRoot}" as temporary directory for a new project.`);
   18   setGlobalVariable('tmp-root', tempRoot);
   19 }