@foresightyj/lazy-git
v1.0.4
Published
This command helps in case where you do not want to run a time-consuming command (e.g. a webpack build which takes a few minutes) if git repository does not have new commits.
Downloads
1
Readme
This command helps in case where you do not want to run a time-consuming command (e.g. a webpack build which takes a few minutes) if git repository does not have new commits.
Usage is pretty similar to cross-env, simply prefix your actual command with lazy-git
, e.g.
cross-env NODE_ENV=production lazy-git webpack --config webpack.prod.js
The first time it runs
$ npm run build:prod
> cross-env NODE_ENV=production lazy-git webpack --config webpack.prod.js
.lazy-git does not exist. It will be made after a successful run.
...
...
webpack 5.37.1 compiled with 2 warnings in 38225 ms
Successfully ran: `webpack --config webpack.prod.js`. Save the corresponding commit hash: 23240f7 style change to .lazy-git
The second time it runs (assuming no new commits):
$ npm run build:prod
> cross-env NODE_ENV=production lazy-git webpack --config webpack.prod.js
Command: `webpack --config webpack.prod.js` is SKIPPED because .lazy-git already has last commit: `23240f7 style change`
To re-run the command, simply delete the file: `D:\Working\FHT.CMS.Web\fht-cms-web-client\.lazy-git` and then retry.
Later, if new commits detected:
/d/Working/FHT.CMS.Web/fht-cms-web-client $ npm run build:prod
cross-env NODE_ENV=production lazy-git webpack --config webpack.prod.js
New commit detected: d2d2506 applied lazy-git
...
...
webpack 5.37.1 compiled with 2 warnings in 38496 ms
Successfully ran: webpack --config webpack.prod.js
. Save the corresponding commit hash: d2d2506 applied lazy-git to .lazy-git
...