grunt-git-deploy icon indicating copy to clipboard operation
grunt-git-deploy copied to clipboard

Do not attempt deploy without changes.

Open don-code opened this issue 8 years ago • 0 comments

Currently, grunt-git-deploy fails with a nondescript error if there are no changes to be committed:

Running "git_deploy:null_deploy" (git_deploy) task
>> Cannot delete nonexistent file.
Running clone -b gh-pages ../repo . in tmp/grunt-git-deploy
Running checkout -B gh-pages in tmp/grunt-git-deploy
Copying tmp/src to tmp/grunt-git-deploy
>> Cannot delete nonexistent file.
Running add --all in tmp/grunt-git-deploy
Running commit --message=null deploy, should not work in tmp/grunt-git-deploy
Warning:  Use --force to continue.

Aborted due to warnings.

This change instead makes it log out an informational message and proceed, by first running git status to see if any files have changed:

Running "git_deploy:null_deploy" (git_deploy) task
>> Cannot delete nonexistent file.
Running clone -b gh-pages ../repo . in tmp/grunt-git-deploy
Running checkout -B gh-pages in tmp/grunt-git-deploy
Copying tmp/src to tmp/grunt-git-deploy
>> Cannot delete nonexistent file.
Nothing for git_deploy to commit.

Done.

don-code avatar May 22 '16 03:05 don-code