MCPcopy Create free account
hub / github.com/angular/dev-infra / checkPortability

Function checkPortability

ng-dev/config/validate/portability.ts:15–35  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

13import {Log} from '../../utils/logging';
14
15export async function checkPortability() {
16 Log.debug('Copying ng-dev configuration to isolated temp directory');
17 const tmpConfigDir = await mkdtemp(join(tmpdir(), 'ng-dev-config-check-'));
18 const repoBaseDir = determineRepoBaseDirFromCwd();
19 try {
20 await cp(join(repoBaseDir, '.ng-dev'), tmpConfigDir, {recursive: true});
21 Log.debug('Validating configuration loads in isolation');
22 const baseConfigFile = join(tmpConfigDir, 'config.mjs');
23 const {status, stderr} = await ChildProcess.exec(`node ${baseConfigFile}`, {
24 cwd: tmpConfigDir,
25 mode: 'silent',
26 });
27 if (status !== 0) {
28 throw Error(stderr);
29 }
30 } catch (err) {
31 throw err;
32 } finally {
33 await rm(tmpConfigDir, {recursive: true, maxRetries: 3});
34 }
35}

Callers 1

handlerFunction · 0.90

Calls 2

execMethod · 0.45

Tested by

no test coverage detected