Skip to content
  • Duncan Coutts's avatar
    Extend file globs and file glob monitors · 2d569609
    Duncan Coutts authored and Mikhail Glushenkov's avatar Mikhail Glushenkov committed
    File globs can now be absolute, e.g. starting with / or c:\
    Also allow homedir relative, ie ~/
    
    Globs can also have a trailing slash, in which case they only match
    directories, not files.
    
    Previously whether globs could match dirs was not totally consistent.
    The matchFileGlob would match dirs, but the file monitor globs would
    not. The file monitor globs can now match dirs (or with a trailing
    slash, only match dirs). File monitors now also detect changes in the
    file type, ie switching from file to dir or the other way around.
    
    The file monitor are now pretty consistent between single file monitors
    and globs monitors. They now have equivalent capabilities and share
    code. For a single file or for a glob we can now control what we
    monitor if the path is a file or a dir. In both cases we can monitor
    mere existence, non-existence or modification time. For files we can
    additionally monitor content hash.
    
    File monitors now also detect changes in the file type, ie switching
    from file to dir or the other way around.
    
    New tests cover all these new file monitor cases. There are also new
    tests for glob syntax, covering printing/parsing round trips.
    
    (cherry picked from commit f6c1e71c)
    2d569609