mirror of
https://github.com/angular/angular-cli.git
synced 2025-05-17 02:54:21 +08:00
fix(@angular-devkit/architect): always clear TestProjectHost on restore
This commit is contained in:
parent
e6be44ff7f
commit
aa3901964d
@ -18,7 +18,7 @@ import {
|
|||||||
import { NodeJsSyncHost } from '@angular-devkit/core/node';
|
import { NodeJsSyncHost } from '@angular-devkit/core/node';
|
||||||
import { Stats } from 'fs';
|
import { Stats } from 'fs';
|
||||||
import { EMPTY, Observable, from, of } from 'rxjs';
|
import { EMPTY, Observable, from, of } from 'rxjs';
|
||||||
import { concatMap, delay, map, mergeMap, retry, tap } from 'rxjs/operators';
|
import { concatMap, delay, finalize, map, mergeMap, retry, tap } from 'rxjs/operators';
|
||||||
|
|
||||||
|
|
||||||
export class TestProjectHost extends NodeJsSyncHost {
|
export class TestProjectHost extends NodeJsSyncHost {
|
||||||
@ -90,13 +90,12 @@ export class TestProjectHost extends NodeJsSyncHost {
|
|||||||
// Wait 50ms and retry up to 10 times, to give time for file locks to clear.
|
// Wait 50ms and retry up to 10 times, to give time for file locks to clear.
|
||||||
return this.exists(this.root()).pipe(
|
return this.exists(this.root()).pipe(
|
||||||
delay(50),
|
delay(50),
|
||||||
concatMap(exists => exists ? this.delete(this.root()) : of(null)),
|
concatMap(exists => exists ? this.delete(this.root()) : EMPTY),
|
||||||
retry(10),
|
retry(10),
|
||||||
tap(() => {
|
finalize(() => {
|
||||||
this._currentRoot = null;
|
this._currentRoot = null;
|
||||||
this._scopedSyncHost = null;
|
this._scopedSyncHost = null;
|
||||||
}),
|
}),
|
||||||
map(() => { }),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user