|
|
|
|
|
by spicypete
433 days ago
|
|
I use `mvdan/sh` [1] under the hood for processing the commands. So it will reformat if [ foo ] ; then
bar
fi
to if [ foo ]
then
bar
fi
And also format your example to foo
bar
In this type of situation, it becomes a little trickier to disambiguate when I need to add semicolons and a backslash, and when I need to add only backslashes. If you use `&&` -- you have disambiguated the two cases so I can format it.[1] https://github.com/mvdan/sh |
|