Skip to content
This repository was archived by the owner on Apr 4, 2025. It is now read-only.

Commit 96d212e

Browse files
filipesilvaclydin
authored andcommitted
fix(@angular-devkit/core): throw observable error on delete
1 parent db594d7 commit 96d212e

File tree

1 file changed

+11
-3
lines changed
  • packages/angular_devkit/core/node

1 file changed

+11
-3
lines changed

packages/angular_devkit/core/node/host.ts

+11-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* found in the LICENSE file at https://angular.io/license
77
*/
88
import * as fs from 'fs';
9-
import { EMPTY, Observable, concat, from as observableFrom } from 'rxjs';
9+
import { EMPTY, Observable, concat, from as observableFrom, throwError } from 'rxjs';
1010
import {
1111
concatMap,
1212
ignoreElements,
@@ -257,9 +257,17 @@ export class NodeJsSyncHost implements virtualFs.Host<fs.Stats> {
257257
for (const name of fs.readdirSync(getSystemPath(path))) {
258258
this.delete(join(path, name)).subscribe();
259259
}
260-
fs.rmdirSync(getSystemPath(path));
260+
try {
261+
fs.rmdirSync(getSystemPath(path));
262+
} catch (error) {
263+
return throwError(error);
264+
}
261265
} else {
262-
fs.unlinkSync(getSystemPath(path));
266+
try {
267+
fs.unlinkSync(getSystemPath(path));
268+
} catch (error) {
269+
return throwError(error);
270+
}
263271
}
264272

265273
return EMPTY;

0 commit comments

Comments
 (0)