File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
packages/angular_devkit/core/src/virtual-fs/host Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ import {
3333 Stats ,
3434} from './interface' ;
3535
36+
3637export interface SimpleMemoryHostStats {
3738 readonly content : FileBuffer | null ;
3839}
@@ -210,6 +211,23 @@ export class SimpleMemoryHost implements Host<{}> {
210211 } else {
211212 const content = this . _cache . get ( from ) ;
212213 if ( content ) {
214+ const fragments = split ( to ) ;
215+ const newDirectories = [ ] ;
216+ let curr : Path = normalize ( '/' ) ;
217+ for ( const fr of fragments ) {
218+ curr = join ( curr , fr ) ;
219+ const maybeStats = this . _cache . get ( fr ) ;
220+ if ( maybeStats ) {
221+ if ( maybeStats . isFile ( ) ) {
222+ throw new PathIsFileException ( curr ) ;
223+ }
224+ } else {
225+ newDirectories . push ( curr ) ;
226+ }
227+ }
228+ for ( const newDirectory of newDirectories ) {
229+ this . _cache . set ( newDirectory , this . _newDirStats ( ) ) ;
230+ }
213231 this . _cache . delete ( from ) ;
214232 this . _cache . set ( to , content ) ;
215233 }
You can’t perform that action at this time.
0 commit comments