bannertime / generator-bannertime

Yeoman generator to help build and manage HTML5 banner campaigns.
https://bannertime.github.io/
58 stars 35 forks source link

fix: when git is not initialised gulp deploy task will use branch deployment #65

Closed joemidi closed 8 years ago

joemidi commented 8 years ago

If you run gulp deploy on a repository before you have used git init, you get the following error:

fatal: Not a git repository (or any parent up to mount point /Volumes/Data)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).

which results in:

On  branch, deploying to bannertime-test-

adding the extra hyphen it uses when creating a branch for deployment.

We should add a condition to the branch check on line 8 if it is returned empty.

if [ "$BRANCH" = "master" ]

to

if [ "$BRANCH" = "master" ] || [ -z "$BRANCH" ]