I’m trying to figure out how to be able to expand ENV variables in either Port or System.cmd. Porcelain seems to be capable of this, but I cannot do it with either Port or System.cmd:
iex(5)> System.cmd("/bin/echo", ["$GOPATH"])
{"$GOPATH\n", 0}
iex(6)> port = Port.open({:spawn_executable, "/bin/echo"}, [:binary, args: ["$GOPATH"]])
#Port<0.10>
iex(7)> flush()
{#Port<0.10>, {:data, "$GOPATH\n"}}
:ok
Porcelain.shell("echo $GOPATH")
%Porcelain.Result{err: nil, out: "/Users/rlthompson/go\n", status: 0}
The issue is Porcelain is in a state where I am uncomfortable using it in production (it’s basically abandonware in my personal opinion). I tried taking a look at how Porcelain is accomplishing this, but was unable to make heads or tails of the specific calls they make.
Any help, direction or docs to be pointed at would be greatly appreciated. Thank you in advance.