Skip to content
This repository has been archived by the owner on Apr 9, 2022. It is now read-only.

Commit

Permalink
fix(@angular-devkit/core): throw observable error on delete
Browse files Browse the repository at this point in the history
  • Loading branch information
filipesilva authored and clydin committed May 29, 2018
1 parent db594d7 commit 96d212e
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions packages/angular_devkit/core/node/host.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* found in the LICENSE file at https://angular.io/license
*/
import * as fs from 'fs';
import { EMPTY, Observable, concat, from as observableFrom } from 'rxjs';
import { EMPTY, Observable, concat, from as observableFrom, throwError } from 'rxjs';
import {
concatMap,
ignoreElements,
Expand Down Expand Up @@ -257,9 +257,17 @@ export class NodeJsSyncHost implements virtualFs.Host<fs.Stats> {
for (const name of fs.readdirSync(getSystemPath(path))) {
this.delete(join(path, name)).subscribe();
}
fs.rmdirSync(getSystemPath(path));
try {
fs.rmdirSync(getSystemPath(path));
} catch (error) {
return throwError(error);
}
} else {
fs.unlinkSync(getSystemPath(path));
try {
fs.unlinkSync(getSystemPath(path));
} catch (error) {
return throwError(error);
}
}

return EMPTY;
Expand Down

0 comments on commit 96d212e

Please sign in to comment.