YQ Basic Install
The snippet can be accessed without any authentication.
Authored by
Paul Gierz
Installs the yq
command line utility for easily parsing YAML files.
install_4p27p2_yq.sh 653 B
#!/bin/bash -e
VERSION=v4.27.2
BINARY=yq_linux_386
if [ ! -d ${HOME}/.local/bin ]; then
mkdir -p ${HOME}/.local/bin
fi
wget https://github.com/mikefarah/yq/releases/download/${VERSION}/${BINARY}.tar.gz -O - |\
tar xz && mv ${BINARY} ${HOME}/.local/bin/yq
my_path="$(command -v yq)"
if [ -z "$my_path" ]; then
echo "'yq' wasn't found in your PATH, so we don't know where to put the man pages."
echo "Please update your PATH to include yq, and run this script again."
exit 1
fi
# ex: ~/.local/bin/yq => ~/.local/
my_prefix="$(dirname "$(dirname "$(command -v yq)")")"
mkdir -p "$my_prefix/share/man/man1/"
mv yq.1 "$my_prefix/share/man/man1/"
Please register or sign in to comment