Skip to content

Commit

Permalink
docs(contributing): yq setup
Browse files Browse the repository at this point in the history
Related: #11
Signed-off-by: John Andersen <johnandersen777@protonmail.com>
  • Loading branch information
johnandersen777 committed Nov 9, 2024
1 parent 265d3d3 commit e288ff2
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,20 @@ for FILE in "${HOME}/.bashrc" "${HOME}/.bash_profile"; do
fi
done
. "${HOME}/.bashrc"

export YQ_VERSION=4.44.3
export YQ_SETUP_DIR="cache/setup/yq/${YQ_VERSION}"
export YQ_INSTALL_DIR="cache/install/yq/${YQ_VERSION}"
curl --create-dirs --output-dir "${YQ_SETUP_DIR}" -fLOC - "https://github.com/mikefarah/yq/releases/download/v${YQ_VERSION}/checksums"
curl --create-dirs --output-dir "${YQ_SETUP_DIR}" -fLOC - "https://github.com/mikefarah/yq/releases/download/v${YQ_VERSION}/yq_linux_amd64.tar.gz"
mkdir -pv "${YQ_INSTALL_DIR}"
tar -xvz -C "${YQ_INSTALL_DIR}" -f "${YQ_SETUP_DIR}/yq_linux_amd64.tar.gz"
mv -v "${YQ_INSTALL_DIR}/yq_linux_amd64" "${YQ_INSTALL_DIR}/yq"
LINE="export PATH=\"${PWD}/${YQ_INSTALL_DIR}:\${PATH}\""
for FILE in "${HOME}/.bashrc" "${HOME}/.bash_profile"; do
if ! grep -qxF "$LINE" "$FILE"; then
echo "$LINE" >> "$FILE"
fi
done
. "${HOME}/.bashrc"
```

0 comments on commit e288ff2

Please sign in to comment.