"Fossies" - the Fresh Open Source Software Archive

Member "angular-cli-15.2.4/tests/legacy-cli/e2e/setup/200-create-project-dir.ts" (16 Mar 2023, 636 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.

    1 import { mkdir } from 'fs/promises';
    2 import { join } from 'path';
    3 import { getGlobalVariable, setGlobalVariable } from '../utils/env';
    4 
    5 /**
    6  * Create a parent directory for test projects to be created within.
    7  * Change the cwd() to that directory in preparation for launching the cli.
    8  */
    9 export default async function () {
   10   const tempRoot: string = getGlobalVariable('tmp-root');
   11   const projectsRoot = join(tempRoot, 'e2e-test');
   12 
   13   setGlobalVariable('projects-root', projectsRoot);
   14 
   15   await mkdir(projectsRoot);
   16 
   17   console.log(`  Using "${projectsRoot}" as temporary directory for a new project.`);
   18   process.chdir(projectsRoot);
   19 }