@foresightyj/lazy-git

1.0.4 • Public • 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.

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 ...

Readme

Keywords

none

Package Sidebar

Install

npm i @foresightyj/lazy-git

Weekly Downloads

1

Version

1.0.4

License

ISC

Unpacked Size

4.27 kB

Total Files

3

Last publish

Collaborators

  • foresightyj