Git “last modified” information¶
import {
GetGitLastModifiedDbProcessor
} from '@phfaist/zoodb/dbprocessor/getgitlastmodified';
- class GetGitLastModifiedDbProcessor()¶
Use git to inspect the last modification time of a source file associated with a given object.
Objects’ meta field
obj._zoodb.git_last_modified_dateis set to a relevant JavaScriptDateinstance.Options:
{ data_dir: ...}data_dir is the folder relative to which we should interpret source file paths.
- GetGitLastModifiedDbProcessor.GetGitLastModifiedDbProcessor¶
- GetGitLastModifiedDbProcessor.get_latest_modification_date()¶
If called after processing the zoo, this method returns the latest encountered modification date of a source file path.
- GetGitLastModifiedDbProcessor.process_object(object_type, objid, obj)¶
Query git for the last modification date of the source file associated with obj and store the result in obj._zoodb.git_last_modified_date. Also updates the internal _latest_modification_date tracker if the new date is later than any previously seen date.
Does nothing for objects without a source_file_path in their _zoodb metadata.
- Arguments:
object_type (string) – The type name of the object.
objid (string) – The ID of the object.
obj (Object) – The database object to annotate.
- Returns:
Promise.<void> –