refactor(@angular/cli): remove deprecated rmdirSync usage

`rmdirSync` usage can be directly replaced with `rmSync`.
For additional Node.js deprecation details, see https://nodejs.org/docs/latest-v16.x/api/deprecations.html#dep0147-fsrmdirpath--recursive-true-
This commit is contained in:
Charles Lyding 2022-06-03 11:01:31 -04:00 committed by Charles
parent 7ddc3fe899
commit ea1f2cee5d

View File

@ -8,7 +8,7 @@
import { isJsonObject, json } from '@angular-devkit/core'; import { isJsonObject, json } from '@angular-devkit/core';
import { execSync, spawn } from 'child_process'; import { execSync, spawn } from 'child_process';
import { existsSync, promises as fs, realpathSync, rmdirSync } from 'fs'; import { existsSync, promises as fs, realpathSync, rmSync } from 'fs';
import { tmpdir } from 'os'; import { tmpdir } from 'os';
import { join } from 'path'; import { join } from 'path';
import { satisfies, valid } from 'semver'; import { satisfies, valid } from 'semver';
@ -111,7 +111,7 @@ export class PackageManagerUtils {
// clean up temp directory on process exit // clean up temp directory on process exit
process.on('exit', () => { process.on('exit', () => {
try { try {
rmdirSync(tempPath, { recursive: true, maxRetries: 3 }); rmSync(tempPath, { recursive: true, maxRetries: 3 });
} catch {} } catch {}
}); });