mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
ci: correctly check for outputPaths to exist before deleting them (#64137)
Properly check if the output paths for each npm package exists before ensuring they are deleted when building all packages PR Close #64137
This commit is contained in:
parent
3b28ee1daa
commit
78cee8eca3
1 changed files with 3 additions and 2 deletions
|
|
@ -6,10 +6,11 @@
|
|||
* found in the LICENSE file at https://angular.dev/license
|
||||
*/
|
||||
|
||||
import {execSync, spawnSync} from 'child_process';
|
||||
import {execSync} from 'child_process';
|
||||
import {join, dirname} from 'path';
|
||||
import {BuiltPackage} from '@angular/ng-dev';
|
||||
import {fileURLToPath} from 'url';
|
||||
import {existsSync, lstatSync} from 'fs';
|
||||
|
||||
/** Path to the project directory. */
|
||||
export const projectDir: string = join(dirname(fileURLToPath(import.meta.url)), '../..');
|
||||
|
|
@ -72,7 +73,7 @@ function buildReleasePackages(
|
|||
// do this to ensure that the version placeholders are properly populated.
|
||||
packageNames.forEach((pkgName) => {
|
||||
const outputPath = getBazelOutputPath(pkgName);
|
||||
if (spawnSync(`[ -d ${outputPath} ]`).status !== 0) {
|
||||
if (existsSync(outputPath) && lstatSync(outputPath).isDirectory()) {
|
||||
exec(`chmod -R u+w ${outputPath}`);
|
||||
exec(`rm -rf ${outputPath}`);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue