Test/tweak Linux support
jonathanbossenger opened this issue · comments
Jonathan Bossenger commented
Mostly, this should already work on a Linux desktop, but it needs to be tested.
We will test with Ubuntu only for now.
Jonathan Bossenger commented
Replace the section that relies on osascript on the Mac and use Python on Linux
INSTANCE_DATA=$( multipass info --format json wp-local-env )
read -r -d '' JXA <<EOF
function run() {
var info = JSON.parse(\`$INSTANCE_DATA\`);
return info.info["wp-local-env"].ipv4;
}
EOF
INSTANCE_IP=$( osascript -l 'JavaScript' <<< "${JXA}" )
See also : https://stackoverflow.com/questions/1955505/parsing-json-with-unix-tools