skybet / cali

Cali Automation Layout Initialiser
MIT License
32 stars 7 forks source link

Auto-detect if host is terminal, and use that to determine if we should run non-interactive #46

Closed lucymhdavies closed 6 years ago

lucymhdavies commented 6 years ago

Using lucli vault to test this.

https://github.com/LMHD/lucli/blob/master/cmd/vault.go

e.g. a container run without this change:

$ lucli vault read -- -field=display_name auth/token/lookup | od -c
0000000  033   [   0   m   l   d   a   p   -   d   a   v   i   e   s   l
                                                                        0000020  033   [   0   m  \r  \n
0000026

Compared to a container run with the change:

$ luclidev vault read -- -field=display_name auth/token/lookup | od -c
0000000  033   [   0   m   l   d   a   p   -   d   a   v   i   e   s   l
0000020  033   [   0   m  \r  \n
0000026

I don't know why using stdout for this works, but stdin does not. But it does, so that's good enough for me.

Partial resolution of https://github.com/skybet/cali/issues/45

Still not quite there yet.

Compared to running the container directly:

0000000    l   d   a   p   -   d   a   v   i   e   s   l
0000014
lucymhdavies commented 6 years ago

With the latest commit, this is now completely resolved

$ luclidev vault read -- -field=display_name auth/token/lookup | od -c
0000000    l   d   a   p   -   d   a   v   i   e   s   l
0000014