bake icon indicating copy to clipboard operation
bake copied to clipboard

Can't define more than one env-variable without indenting

Open mortenlj opened this issue 5 years ago • 0 comments

I'm testing bake, and wanted to define two environment variables at the start that would apply to all tasks. Strangely enough, only the first one takes effect, the second one is ignored. If I indent the second one, it is suddenly included. This is very confusing.

With this Bakefile:

VERSION="$(date +%Y%m%d%H%M%S)-$(git rev-parse --short HEAD)"
NAME="example.com/project/fake:${VERSION}"

fake:
    echo NAME="${NAME}"
    echo VERSION="${VERSION}"

This is the output:

 bake fake
 + Executing fake:
 |  NAME=
 |  VERSION=20191030205511-faace62
 + Done.

If I change it to this:

VERSION="$(date +%Y%m%d%H%M%S)-$(git rev-parse --short HEAD)"
  NAME="example.com/project/fake:${VERSION}"

fake:
    echo NAME="${NAME}"
    echo VERSION="${VERSION}"

This is the output:

 bake fake
 + Executing fake:
 |  NAME=example.com/project/fake:20191030205539-faace62
 |  VERSION=20191030205539-faace62
 + Done.

mortenlj avatar Oct 30 '19 19:10 mortenlj