Generate git.properties.json with basic git properties like current git commit hash, branch, and time.
import gitProperties from "git-properties";
async () => {
await gitProperties();
};
Parameters | Description | Default |
---|---|---|
destFile | Set the destination of the generated file | Default to project root path |
yarn build
yarn test
git.properties.json
{
branch: "master",
commit: {
message: "update README.md",
id: "8c7f48581094cb1e9ce68f33f2631e3bd7927591",
time: "2020-08-23T00:00:00.000Z",
user: { name: "User", email: "[email protected]" },
},
}