Closed mkyc closed 2 years ago
@mkyc No problem!!
@mkyc You can download updated version from https://github.com/lechuckroh/task-intellij-plugin/releases/tag/v1.3.0 before publicly available
@lechuckroh it does work with environment variables syntax β€οΈ
version: '3'
env:
TEST: test
tasks:
print:
desc: echo TEST env
cmds:
- echo TEST=$TEST
task --taskfile /lalala/Taskfile.yml print
TEST=test2
task: [print] echo TEST=$TEST
Process finished with exit code 0
It does not work with variables syntax though.
version: '3'
vars:
TEST: test
tasks:
print:
desc: echo TEST env
cmds:
- echo TEST={{.TEST}}
task --taskfile /lalala/Taskfile.yml print
TEST=test
task: [print] echo TEST=test
Process finished with exit code 0
That solves my issue for sure, but I guess variables syntax would be nice to have as well.
Great job!
@mkyc
In my environment (Mac + zsh), variables syntax works as expected.
task --taskfile /lalala/Taskfile.yml print
TEST=test2
task: [print] echo TEST=test2
Process finished with exit code 0
Since some shells donβt support above syntax to set environment variables (Windows) tasks also accepts a similar style when not in the beginning of the command.
It seems your shell doesn't support environment variables. π’
I'll reopen this issue and working on your case..
Thank you for your reporting. π
@lechuckroh that is interesting.
With code
version: '3'
vars:
TEST: test
tasks:
print:
desc: echo TEST env
cmds:
- echo TEST={{.TEST}}
I get directly in shell:
β p git:(mkyc/b1) β TEST=test2 task print
task: [print] echo TEST=test
TEST=test
β p git:(mkyc/b1) β task print TEST=test2
task: [print] echo TEST=test2
TEST=test2
β p git:(mkyc/b1) β echo $SHELL
/bin/zsh
@mkyc Oops!! sorry.. I omitted vars:
block in my Taskfile.yml
.
Now I got the same output with you.. π
@mkyc You can download v1.3.1 from https://github.com/lechuckroh/task-intellij-plugin/releases/tag/v1.3.1
task --taskfile /foo/Taskfile.yml print TEST=\"test2\" "TEST2=\"foo bar\""
version: '3'
vars:
TEST: test
tasks:
print:
cmds:
- cat Taskfile.yml
- echo TEST={{.TEST}} TEST2={{.TEST2}}
TEST=test2 TEST2=foo bar
task: [print] cat Taskfile.yml
task: [print] echo TEST="test2" TEST2="foo bar"
Process finished with exit code 0
Now it works as expected!!
Works perfectly right now π
With code:
version: '3'
env:
TEST1: test
vars:
TEST2: test
tasks:
print:
desc: echo TEST env
cmds:
- echo TEST1=$TEST1
- echo TEST2={{.TEST2}}
and configuration:
I get output as expected:
task --taskfile /lalala/Taskfile.yml print TEST2=\"test2\"
task: [print] echo TEST1=$TEST1
task: [print] echo TEST2="test2"
TEST1=test1
TEST2=test2
Process finished with exit code 0
So from that perspective all looks cool, thank you!
Two more suggestions but rather UI related:
Anyways great job!
@mkyc
if that is possible then window to edit variables same as environment variables would be nice. Environment variables editor is a built-in component, but variable editor requires custom editor.
I would move "Variables" input under "Variables" label same as you did with environment variables. This will be resolved when custom editor is implemented.
Thank you for greate your feedbacks. β€οΈ
I'll continue on another issue, and close this issue.
Hi, amazing plugin!
I'd like to run task with variables i.e.,