I have the following "make" task:
PKGS = $(shell go list ./... | grep -v /vendor/ | grep -v /bindata)
lint:
golint $(PKGS)
How would I do the same with "task" ?
I tried many things like:
version: '2'
vars:
PKGS:
sh: go list ./... | grep -v /vendor/ | grep -v /bindata
tasks:
lint:
cmds:
- golint {{.PKGS}}
or: - golint {{join .PKGS " "}} or - golint {{join " " .PKGS}}
but nothing works.
It execute:
golint myApp
myApp/pkg/actions
myApp/pkg/color
myApp/pkg/config
instead of:
golint myApp myApp/pkg/actions myApp/pkg/color myApp/pkg/config
Hi @alaingilbert,
Unlike Make, Task doesn't automatically convert new lines into spaces on interpolation. But there's a helper method for that catLines:
version: '2'
vars:
PKGS:
sh: go list ./... | grep -v /vendor/ | grep -v /bindata
tasks:
lint:
cmds:
- golint {{catLines .PKGS}}
This should do the trick.
Awesome, that works perfectly.
I had the following workaround | tr '\n' ' '
but I prefer the helper.