是什么 ? | : | a lightweight and portable command-line YAML processor. |
开发语言 | : | golang |
官方主页 | : | https://mikefarah.gitbook.io/yq |
源码仓库 | : | https://github.com/mikefarah/yq |
操作系统 | 包管理器 | 仓库 | 安装命令 |
---|---|---|---|
All | vcpkg | official | vcpkg install yq vcpkg install yq:x64-osx vcpkg install yq:x64-linux vcpkg install yq:x64-windows |
Windows | Chocolatey | official | choco install -y yq |
macOS | HomeBrew | official | brew install yq |
GNU/Linux | HomeBrew | official | brew install yq |
apt | official | sudo apt-get install -y yq | |
CentOS | yum | sudo yum install -y yq | |
dnf | sudo dnf install -y yq | ||
openSUSE | zypper | sudo zypper install -y yq | |
Alpine Linux | apk | official | sudo apk add yq |
pacman | official | sudo pacman -Syyu --noconfirm | |
Gentoo Linux | Portage | official | sudo emerge yq |
step1、安装依赖
所有时 | Terminal + Shell |
下载时 | cURL |
解压时 | tar + gzip |
运行时 |
|
step2、使用curl命令下载编译好的二进制压缩包 ()
curl -LO https://github.com/mikefarah/yq/releases/download/v4.9.3/yq_darwin_amd64.tar.gz
step3、使用tar解压压缩包到/usr/local/bin
目录下
tar vxf yq_darwin_amd64.tar.gz -C /usr/local/bin
step4、将yq_darwin_amd64
重命名为yq
mv /usr/local/bin/yq_darwin_amd64 /usr/local/bin/yq
step1、安装依赖
所有时 | Terminal + Shell |
下载时 | git |
编译时 | GoToolchain |
运行时 |
|
step2、设置GOPATH
等环境变量
export GOPATH=~/go/yq
export GO111MODULE=auto
export GOPROXY=https://goproxy.io
step3、使用go get下载hugo
源码并编译
go get -v github.com/mikefarah/yq
step4、将$GOPATH/bin/yq
安装到/usr/local/bin/
目录中
sudo install -o $(whoami) -m 755 $GOPATH/bin/yq /usr/local/bin/